mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 18:50:21 -07:00
[PR #6848/11406715 backport][stable-7] npm: replace test with required_if (#6856)
npm: replace test with required_if (#6848)
* npm: replace test with required_if
* add changelog frag
(cherry picked from commit 11406715f5
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
1c8fbed36c
commit
42cc5280d9
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