From 246885f897101f8a7c3175c93d91b838c5641b61 Mon Sep 17 00:00:00 2001 From: Grzegorz Nowak Date: Tue, 4 May 2021 13:57:43 +0200 Subject: [PATCH] fix idempotence and remove debugs --- tasks/_symlink.yml | 8 -------- tasks/main.yml | 10 +++++----- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/tasks/_symlink.yml b/tasks/_symlink.yml index 061bf5f..581f713 100644 --- a/tasks/_symlink.yml +++ b/tasks/_symlink.yml @@ -7,10 +7,6 @@ register: package_stats_1 when: item.name is defined -- debug: - var: package_stats_1 - changed_when: true - - name: Symlink global packages into PATH for specific environments (like cron's) to be able to access them. file: src="{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/{{ item.name }}" dest="/usr/bin/{{ item.name }}" state=link mode="u+rwx,g+rx,o+rx" @@ -22,10 +18,6 @@ register: package_stats_2 when: item.name is not defined -- debug: - var: package_stats_2 - changed_when: true - - name: Symlink global packages into PATH for specific environments (like cron's) to be able to access them. file: src="{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/{{ item }}" dest="/usr/bin/{{ item }}" state=link mode="u+rwx,g+rx,o+rx" diff --git a/tasks/main.yml b/tasks/main.yml index 8154e69..a4f49a8 100755 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -55,7 +55,7 @@ shell: cmd: ". /root/.bashrc && {{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/npm \ install --global {{ item.name }}@{{ item.version }}" - creates: "{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/{{ item.name }}" + creates: "{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/lib/node_modules/{{ item.name }}" loop: "{{ nvm_install_globally }}" when: item.name is defined and item.version is defined and item.flags is not defined @@ -63,7 +63,7 @@ shell: cmd: ". /root/.bashrc && {{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/npm \ install --global {{ item.flags }} {{ item.name }}@{{ item.version }}" - creates: "{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/{{ item.name }}" + creates: "{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/lib/node_modules/{{ item.name }}" loop: "{{ nvm_install_globally }}" when: item.name is defined and item.version is defined and item.flags is defined @@ -71,7 +71,7 @@ shell: cmd: ". /root/.bashrc && {{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/npm \ install --global {{ item }}" - creates: "{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/{{ item }}" + creates: "{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/lib/node_modules/{{ item }}" loop: "{{ nvm_install_globally }}" when: item.name is not defined @@ -79,7 +79,7 @@ shell: cmd: ". /root/.bashrc && {{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/npm \ install --global {{ item.name }}" - creates: "{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/{{ item.name }}" + creates: "{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/lib/node_modules/{{ item.name }}" loop: "{{ nvm_install_globally }}" when: item.name is defined and item.version is not defined and item.flags is not defined @@ -87,7 +87,7 @@ shell: cmd: ". /root/.bashrc && {{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/npm \ install --global {{ item.flags }} {{ item.name }}" - creates: "{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/bin/{{ item.name }}" + creates: "{{ nvm_dir }}/versions/node/v{{ nvm_node_version }}/lib/node_modules/{{ item.name }}" loop: "{{ nvm_install_globally }}" when: item.name is defined and item.version is not defined and item.flags is defined