From 8483caab0881f22c04f6250440587c258aa4dbe4 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Sun, 27 Oct 2019 17:35:18 +1100 Subject: [PATCH] ansible: prepare jenkins-workspace machines for linting duty Ref: https://github.com/nodejs/build/issues/2001 --- ansible/inventory.yml | 2 +- ansible/playbooks/jenkins/worker/create.yml | 35 ++----------------- ansible/roles/baselayout/vars/main.yml | 2 +- .../roles/jenkins-workspace/tasks/main.yml | 28 +++++++++++++++ 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/ansible/inventory.yml b/ansible/inventory.yml index ffbbf2675..88d6cb04f 100644 --- a/ansible/inventory.yml +++ b/ansible/inventory.yml @@ -225,7 +225,7 @@ hosts: ubuntu1604-arm64-2: {ip: 147.75.74.174} # when adding, removing or changing the IPs below, # remember to update Jenkins worker IP whitelist in github-bot - ubuntu1604-x64-1: {ip: 147.75.70.237, alias: jenkins-workspace-1} + ubuntu1604-x64-1: {ip: 147.75.70.41, alias: jenkins-workspace-1} ubuntu1604-x64-2: {ip: 147.75.73.189, alias: jenkins-workspace-2} - nearform: diff --git a/ansible/playbooks/jenkins/worker/create.yml b/ansible/playbooks/jenkins/worker/create.yml index ca2a135ec..0003960f3 100644 --- a/ansible/playbooks/jenkins/worker/create.yml +++ b/ansible/playbooks/jenkins/worker/create.yml @@ -68,42 +68,13 @@ roles: - linux-perf -# -# Set up linter servers -# - -- hosts: - - test-joyent-freebsd10-x64-2 - - test-rackspace-freebsd10-x64-1 - - tasks: - - name: install lint-related packages - package: - name: "{{ package }}" - state: present - loop_control: - loop_var: package - with_items: [ "node", "npm" ] - - - name: install core-validate-commit - npm: - name: "core-validate-commit" - global: yes - state: present - production: yes - - - name: periodically update core-validate-commit - cron: - special_time: daily - # ksh does different stdout/err routing - job: "npm update -g core-validate-commit > & /dev/null" - # Ensure node is not installed anywhere but the linter servers - hosts: - test - release - - "!test-joyent-freebsd10-x64-2" - - "!test-rackspace-freebsd10-x64-1" + - "!test-packetnet-ubuntu1604-x64-1" + - "!test-packetnet-ubuntu1604-x64-2" + - "!test-softlayer-ubuntu1604-x64-1" tasks: - name: remove node and npm packages when: not os|startswith("win") and not os|startswith("zos") diff --git a/ansible/roles/baselayout/vars/main.yml b/ansible/roles/baselayout/vars/main.yml index 9a363b952..bafedb096 100644 --- a/ansible/roles/baselayout/vars/main.yml +++ b/ansible/roles/baselayout/vars/main.yml @@ -114,7 +114,7 @@ packages: { ], ubuntu: [ - 'ccache,g++,gcc,g++-6,gcc-6,git,libfontconfig1,sudo', + 'ccache,g++,gcc,g++-6,gcc-6,git,libfontconfig1,sudo,python3-pip', ], ubuntu1404: [ diff --git a/ansible/roles/jenkins-workspace/tasks/main.yml b/ansible/roles/jenkins-workspace/tasks/main.yml index 774ec66a1..cec895b4d 100644 --- a/ansible/roles/jenkins-workspace/tasks/main.yml +++ b/ansible/roles/jenkins-workspace/tasks/main.yml @@ -106,3 +106,31 @@ command: "git config gc.auto 0" args: chdir: "~binary_tmp/binary_tmp.git/" + +- name: Add nodesource signing key + apt_key: + url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key + state: present + +- name: Add nodesource repo + apt_repository: + repo: deb https://deb.nodesource.com/node_12.x xenial main + state: present + +- name: Install node + package: + name: nodejs + state: present + +- name: Upgrade pip2 + pip: + name: pip + executable: pip2 + state: latest + +- name: Upgrade pip3 + pip: + name: pip + executable: pip3 + state: latest +