diff options
author | Jessica Wagantall <jwagantall@linuxfoundation.org> | 2023-04-12 16:11:10 -0700 |
---|---|---|
committer | Jessica Wagantall <jwagantall@linuxfoundation.org> | 2023-04-13 13:05:35 -0700 |
commit | f7d0136f7264376ded2544e9ee14d2fad684dda6 (patch) | |
tree | 328f22be9768e2716aea0f2bfdc018bcf3bd6332 /packer | |
parent | bffbf597d60567e6c58f8def7bc173a641ac81ea (diff) |
Fix: Re-structure nodejs installation
Issue-ID: CIMAN-33
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
Change-Id: Iace186aafa4391cc7b064bfeacd3043362a79f7d
Diffstat (limited to 'packer')
-rw-r--r-- | packer/provision/local-docker.yaml | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/packer/provision/local-docker.yaml b/packer/provision/local-docker.yaml index 885996101..ec37f51ac 100644 --- a/packer/provision/local-docker.yaml +++ b/packer/provision/local-docker.yaml @@ -188,11 +188,35 @@ become: true when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04' - - name: Install nodejs and npm + - name: Install nodejs + block: + - name: install nodejs prerequisites + apt: + name: + - apt-transport-https + - g++ + update_cache: yes + state: present + become: true + - name: add nodejs apt key + apt_key: + url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key + state: present + - name: add nodejs repository + apt_repository: + repo: deb https://deb.nodesource.com/node_19.x {{ ansible_distribution_release }} main + state: latest + update_cache: yes + - name: install nodejs + apt: + name: + - nodejs + state: present + become: true + when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04' + + - name: Check nodejs and npm versions block: - - name: 'Pull latest nodejs version' - command: 'curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && sudo apt-get install -y nodejs' - become: yes - name: 'Check nodejs version' command: node --version - name: 'Check npm version' |