mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
npm: replace test with required_if (#6848)
* npm: replace test with required_if * add changelog frag
This commit is contained in:
parent
c34a22717e
commit
11406715f5
3 changed files with 6 additions and 14 deletions
|
@ -12,10 +12,10 @@
|
|||
# sample: node-v8.2.0-linux-x64.tar.xz
|
||||
node_path: '{{ remote_dir }}/{{ nodejs_path }}/bin'
|
||||
package: 'iconv-lite'
|
||||
environment:
|
||||
PATH: '{{ node_path }}:{{ ansible_env.PATH }}'
|
||||
block:
|
||||
- shell: npm --version
|
||||
environment:
|
||||
PATH: '{{ node_path }}:{{ ansible_env.PATH }}'
|
||||
register: npm_version
|
||||
|
||||
- debug:
|
||||
|
@ -24,11 +24,8 @@
|
|||
- name: 'Install simple package without dependency'
|
||||
npm:
|
||||
path: '{{ remote_dir }}'
|
||||
executable: '{{ node_path }}/npm'
|
||||
state: present
|
||||
name: '{{ package }}'
|
||||
environment:
|
||||
PATH: '{{ node_path }}:{{ ansible_env.PATH }}'
|
||||
register: npm_install
|
||||
|
||||
- assert:
|
||||
|
@ -39,11 +36,8 @@
|
|||
- name: 'Reinstall simple package without dependency'
|
||||
npm:
|
||||
path: '{{ remote_dir }}'
|
||||
executable: '{{ node_path }}/npm'
|
||||
state: present
|
||||
name: '{{ package }}'
|
||||
environment:
|
||||
PATH: '{{ node_path }}:{{ ansible_env.PATH }}'
|
||||
register: npm_reinstall
|
||||
|
||||
- name: Check there is no change
|
||||
|
@ -60,11 +54,8 @@
|
|||
- name: 'reinstall simple package'
|
||||
npm:
|
||||
path: '{{ remote_dir }}'
|
||||
executable: '{{ node_path }}/npm'
|
||||
state: present
|
||||
name: '{{ package }}'
|
||||
environment:
|
||||
PATH: '{{ node_path }}:{{ ansible_env.PATH }}'
|
||||
register: npm_fix_install
|
||||
|
||||
- name: Check result is changed and successful
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue