Skip to content

Commit

Permalink
ansible: add new jenkins-workspace machines (#3036)
Browse files Browse the repository at this point in the history
Add two new `jenkins-workspace` machines:
- test-equinix-ubuntu2204-x64-1
- test-equinix-ubuntu2204-x64-2

Refs: #3028
  • Loading branch information
richardlau committed Sep 27, 2022
1 parent b8bba8b commit 8734e1e
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 10 deletions.
4 changes: 4 additions & 0 deletions ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ hosts:
- equinix:
ubuntu2004_docker-arm64-1: {ip: 145.40.81.219}
ubuntu2004_docker-arm64-3: {ip: 145.40.99.31}
# when adding, removing or changing the IPs below,
# remember to update Jenkins worker IP whitelist in github-bot
ubuntu2204-x64-1: {ip: 147.75.72.255, alias: jenkins-workspace-7}
ubuntu2204-x64-2: {ip: 145.40.96.123, alias: jenkins-workspace-8}

- ibm:
aix71-ppc64_be-3:
Expand Down
4 changes: 4 additions & 0 deletions ansible/playbooks/jenkins/worker/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
#

- hosts:
- test-equinix-ubuntu2204-x64-1
- test-equinix-ubuntu2204-x64-2
- test-packetnet-ubuntu1804-x64-1
- test-packetnet-ubuntu1804-x64-2
- test-ibm-ubuntu1804-x64-1
Expand All @@ -80,6 +82,8 @@
- hosts:
- test
- release
- "!test-equinix-ubuntu2204-x64-1"
- "!test-equinix-ubuntu2204-x64-2"
- "!test-packetnet-ubuntu1804-x64-1"
- "!test-packetnet-ubuntu1804-x64-2"
- "!test-ibm-ubuntu1804-x64-1"
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/baselayout/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,9 @@ packages: {
# Default gcc/g++ package is 7.
ubuntu1804: [
'gcc-6,g++-6,gcc-8,g++-8',
],

ubuntu2204: [
'gcc,g++,python2,python3,python-is-python3',
],
}
2 changes: 1 addition & 1 deletion ansible/roles/github-bot/templates/environment-file.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ JENKINS_JOB_CITGM={{ envs.jenkins_job_citgm }}
JENKINS_BUILD_TOKEN_CITGM={{ envs.jenkins_build_token_citgm }}
JENKINS_JOB_NODE={{ envs.jenkins_job_node }}
JENKINS_BUILD_TOKEN_NODE={{ envs.jenkins_build_token_node }}
JENKINS_WORKER_IPS=147.75.70.237,51.15.200.62,51.15.218.201,163.172.186.154,147.75.66.203,147.75.81.67,52.117.26.14
JENKINS_WORKER_IPS=147.75.70.237,51.15.200.62,51.15.218.201,163.172.186.154,147.75.66.203,147.75.81.67,52.117.26.14,147.75.72.255,145.40.96.123
1 change: 1 addition & 0 deletions ansible/roles/java-base/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ packages: {
'smartos': 'openjdk8',
'ubuntu': 'openjdk-8-jre-headless',
'ubuntu1404': 'oracle-java8-installer',
'ubuntu2204': 'openjdk-17-jre-headless',
}

java_package_name: "{{ packages[os]|default(packages[os|stripversion])|default(omit) }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

#
# ubuntu series: python 3
#

- name: install pip
package: name=python3-pip state=present

- name: install tap2junit
pip: name=tap2junit state=present
2 changes: 1 addition & 1 deletion ansible/roles/jenkins-worker/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ init: {
freebsd: 'freebsd',
ibmi: 'ibmi73',
macos: 'macos',
systemd: ['centos7', 'debian8', 'debian9', 'debian10', 'fedora', 'rhel7', 'rhel8', 'ubuntu1604', 'ubuntu1804'],
systemd: ['centos7', 'debian8', 'debian9', 'debian10', 'fedora', 'rhel7', 'rhel8', 'ubuntu1604', 'ubuntu1804','ubuntu2204'],
svc: 'smartos',
upstart: ['ubuntu12', 'ubuntu1404'],
zos_start: 'zos'
Expand Down
24 changes: 16 additions & 8 deletions ansible/roles/jenkins-workspace/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@

# Repository needs to be created in /home/iojs/build because the partition with
# free space might be mounted in a way that does not include /home/binary_tmp
- name: Create repository parent directory
file:
path: "{{ home }}/{{ server_user }}/build/"
state: directory
owner: "{{ server_user }}"
group: "{{ server_user }}"
mode: 0755

- name: Create repository directory
file:
path: "{{ home }}/{{ server_user }}/build/binary_tmp.git"
Expand Down Expand Up @@ -114,14 +122,20 @@
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present

- name: Get Ubuntu codename
ansible.builtin.command: "lsb_release -s -c"
changed_when: no
check_mode: no
register: release_codename

- name: Add nodesource repo
apt_repository:
repo: deb https://deb.nodesource.com/node_14.x xenial main
repo: deb https://deb.nodesource.com/node_14.x {{ release_codename.stdout }} main
state: present

- name: Remove earlier nodesource repos
apt_repository:
repo: deb https://deb.nodesource.com/node_12.x xenial main
repo: deb https://deb.nodesource.com/node_12.x {{ release_codename.stdout }} main
state: absent

- name: Install node
Expand All @@ -130,12 +144,6 @@
state: present
update_cache: yes

- name: Upgrade pip2
pip:
name: pip
executable: pip2
state: latest

- name: Upgrade pip3
pip:
name: pip
Expand Down

0 comments on commit 8734e1e

Please sign in to comment.