Fix: Fix ansible steps to install NodeJS and NPM 92/134092/1
authorJessica Wagantall <jwagantall@linuxfoundation.org>
Wed, 12 Apr 2023 18:43:26 +0000 (11:43 -0700)
committerJessica Wagantall <jwagantall@linuxfoundation.org>
Wed, 12 Apr 2023 18:43:26 +0000 (11:43 -0700)
Restructure NodeJS and NPM installation for 20.04
https://github.com/nodesource/distributions

Issue-ID: CIMAN-33
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
Change-Id: I27d9f31d798c231a6b19c40cf8c4753bf1d3935d

packer/provision/local-docker.yaml

index 32aa2c3..c86f1e1 100644 (file)
         update_cache: yes
         state: fixed
       become: true
+      when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
+
+    - 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: build-essential
+        update_cache: yes
+        state: fixed
+      become: true
       when: ansible_distribution == 'Ubuntu'
 
     - name: npm self-update