Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
4 changes: 2 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ npm_config_prefix: "/usr/local/lib/npm"

# Set to true to suppress the UID/GID switching when running package scripts. If
# set explicitly to false, then installing as a non-root user will fail.
npm_config_unsafe_perm: "false"
npm_config_unsafe_perm: false

# Define a list of global packages to be installed with NPM.
nodejs_npm_global_packages: []
Expand All @@ -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
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)