From 26de039db68ab01b1c9f8e8871e627656d8d43c8 Mon Sep 17 00:00:00 2001 From: Yethal <26117918+Yethal@users.noreply.github.com> Date: Mon, 15 Sep 2025 07:36:16 +0200 Subject: [PATCH 1/2] Make nodejs_generate_etc_profile an actual bool --- README.md | 2 +- defaults/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ef501b2..b6fd3f6 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ nodejs_package_json_path: "" Set a path pointing to a particular `package.json` (e.g. `"/var/www/app/package.json"`). This will install all of the defined packages globally using Ansible's `npm` module. ```yaml -nodejs_generate_etc_profile: "true" +nodejs_generate_etc_profile: true ``` By default the role will create `/etc/profile.d/npm.sh` with exported variables (`PATH`, `NPM_CONFIG_PREFIX`, `NODE_PATH`). If you prefer to avoid generating that file (e.g. you want to set the variables yourself for a non-global install), set it to "false". diff --git a/defaults/main.yml b/defaults/main.yml index 4192791..bffbe14 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -28,4 +28,4 @@ nodejs_package_json_path: "" # Whether or not /etc/profile.d/npm.sh (globa) must be generated. # Set to false if you need to handle this manually with a per-user install. -nodejs_generate_etc_profile: "true" +nodejs_generate_etc_profile: true From bbb2b52f66961155f7c16cc10fda3f60adfaab09 Mon Sep 17 00:00:00 2001 From: Yethal <26117918+Yethal@users.noreply.github.com> Date: Mon, 15 Sep 2025 14:01:03 +0200 Subject: [PATCH 2/2] Coerce nodejs_package_json_path to bool in when statement --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 42d5a02..a15ce75 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -40,4 +40,4 @@ - name: Install packages defined in a given package.json. npm: path: "{{ nodejs_package_json_path }}" - when: nodejs_package_json_path is defined and nodejs_package_json_path + when: nodejs_package_json_path is defined and nodejs_package_json_path | bool