diff options
author | Jessica Wagantall <jwagantall@linuxfoundation.org> | 2023-04-11 14:37:26 -0700 |
---|---|---|
committer | Jessica Wagantall <jwagantall@linuxfoundation.org> | 2023-04-11 14:37:26 -0700 |
commit | 049b42e5753a1f12dc176aa29dbabf0024130e54 (patch) | |
tree | 4945cbdaead812675d7dfccd45f14632d240f9e5 /packer | |
parent | cde01027e639a34684fe175757e6b12641464534 (diff) |
Fix: Fix ansible steps to install NodeJS and NPM
Restructure NodeJS and NPM installation
https://github.com/nodesource/distributions
Issue-ID: CIMAN-33
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
Change-Id: I09335dc462961dd9f7ebdff273121bc2661d6931
Diffstat (limited to 'packer')
-rw-r--r-- | packer/provision/local-builder.yaml | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/packer/provision/local-builder.yaml b/packer/provision/local-builder.yaml index fa969d51f..0e2976aa8 100644 --- a/packer/provision/local-builder.yaml +++ b/packer/provision/local-builder.yaml @@ -68,22 +68,6 @@ become: true when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04' - - name: Install nodejs-dev dep for npm - apt: - name: nodejs-dev - update_cache: yes - state: fixed - become: true - when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04' - - - name: Install libnode-dev dep for npm - apt: - name: libnode-dev - update_cache: yes - state: fixed - become: true - when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04' - - name: Install supporting packages (Ubuntu 18.04) apt: name: @@ -128,12 +112,20 @@ become: true when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04' - - name: Install npm and addon packages + - name: Install nodejs and npm + 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' + command: npm --version + when: ansible_distribution == 'Ubuntu' + + - name: Install npm build tools apt: - name: - - nodejs - - npm - - node-gyp + name: build-essential update_cache: yes state: fixed become: true |