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 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