From 3c70bc5b2a1e7505971090867378f72fa9219249 Mon Sep 17 00:00:00 2001 From: Rshad Zhran Date: Thu, 21 Nov 2019 13:13:36 +0100 Subject: [PATCH] Update NodJS installation tasks --- .../ansible-wazuh-manager/tasks/RedHat.yml | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml b/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml index c8e8a95a..5503a10c 100644 --- a/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml +++ b/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml @@ -1,25 +1,5 @@ --- -- name: RedHat/CentOS | Install Nodejs repo - yum_repository: - name: NodeJS - description: NodeJS-$releasever - baseurl: https://rpm.nodesource.com/pub_6.x/el/{{ ansible_distribution_major_version }}/x86_64 - gpgkey: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL - gpgcheck: true - changed_when: false - when: - - ansible_distribution_major_version|int > 5 - -- name: Fedora | Install Nodejs repo - yum_repository: - name: NodeJS - description: NodeJS-$releasever - baseurl: https://rpm.nodesource.com/pub_6.x/fc/$releasever/x86_64 - gpgkey: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL - gpgcheck: true - when: ansible_distribution == 'Fedora' - -- name: AmazonLinux | Get Nodejs +- name: Centos | Get Nodejs shell: | set -o pipefail curl --silent --location https://rpm.nodesource.com/setup_8.x | bash - @@ -27,8 +7,28 @@ warn: false executable: /bin/bash creates: /etc/yum.repos.d/nodesource-el7.repo + when: + - ansible_distribution_major_version|int > 5 + +- name: AmazonLinux/Fedora| Get Nodejs + shell: | + set -o pipefail + curl --silent --location https://rpm.nodesource.com/setup_8.x | bash - + args: + warn: false + executable: /bin/bash when: - ansible_distribution|lower == "amazon" + - ansible_distribution == 'Fedora' + +- name: CentOS/RedHat/Amazon/Fedora | Install NodeJS + package: + name: "nodejs" + state: present + register: nodejs_is_installed + until: nodejs_is_installed is succeeded + tags: + - init - name: RedHat/CentOS 5 | Install Wazuh repo yum_repository: