Skip to content

Commit 48cc0d9

Browse files
committed
ansible: add RHEL 8
Extend Ansible and Jenkins scripts for Red Hat Enterprise Linux 8. Also add new `release-builder` role, for setting up ssh config and keys to upload to the staging server, and changes to make the playbook idempotent.
1 parent 472b295 commit 48cc0d9

File tree

25 files changed

+221
-7
lines changed

25 files changed

+221
-7
lines changed

ansible/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ debugging problems, see the
234234

235235
Unsorted stuff of things we need to do/think about
236236

237-
- [ ] playbook: copy keys and config to release machines
237+
- [x] playbook: copy keys and config to release machines
238238
- [ ] avoid messing with keys on machines that has multiple usage such as jump
239239
hosts (or set up a new jump host)
240-
- [ ] copy release (staging) keys to release machines
240+
- [x] copy release (staging) keys to release machines
241241
- [ ] backup host: generate config, install rsnapshot
242242
- [ ] switch to slaveLog for all jenkins instances lacking stdout redirection
243243
(note: this depends on init type!)
@@ -262,7 +262,7 @@ Unsorted stuff of things we need to do/think about
262262
setup/raspberry-pi/README.md, some of these can be automated)
263263
- [ ] epel-release for centos - required for centos7 on packet.net arm64
264264
before ccache can be installed
265-
- [ ] make .ssh/config and .ssh/id_rsa for release machines, adding config
265+
- [x] make .ssh/config and .ssh/id_rsa for release machines, adding config
266266
for `node-www` and record host key for node-www
267267
- [ ] add explicit ARCH and DESTCPU for release machines (RV: I'm adding
268268
"arm64" manually for both to force the right thing, from memory I've

ansible/inventory.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ hosts:
4646
ip: 169.48.19.173
4747
server_jobs: 6
4848
rhel7-s390x-1: {ip: 148.100.86.101, user: linux1}
49+
rhel8-s390x-1: {ip: 148.100.84.27, user: linux1}
4950

5051
- iinthecloud:
5152
ibmi73-ppc64_be-1: {ip: 65.183.160.62, user: nodejs}
@@ -152,6 +153,9 @@ hosts:
152153
rhel7-s390x-2: {ip: 148.100.86.117, user: linux1, build_test_v8: yes}
153154
rhel7-s390x-3: {ip: 148.100.86.28, user: linux1, build_test_v8: yes}
154155
rhel7-s390x-4: {ip: 148.100.86.94, user: linux1, build_test_v8: yes}
156+
rhel8-s390x-1: {ip: 148.100.84.112, user: linux1, build_test_v8: yes}
157+
rhel8-s390x-2: {ip: 148.100.84.240, user: linux1, build_test_v8: yes}
158+
rhel8-s390x-3: {ip: 148.100.84.56, user: linux1, build_test_v8: yes}
155159
ubuntu1804-x64-1: {ip: 52.117.26.14, alias: jenkins-workspace-6}
156160
ubuntu1804-x64-2: {ip: 50.97.245.9}
157161

ansible/playbooks/jenkins/worker/create.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
- { role: 'benchmarking',
1717
when: is_benchmark is defined and is_benchmark|bool == True }
1818
- jenkins-worker
19+
- { role: release-builder,
20+
when: '"release" in group_names' }
1921

2022
pre_tasks:
2123
# Requires `secret: XXX` to be in the ansible/host_vars/HOST

ansible/roles/baselayout/tasks/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@
141141
state: link
142142
src: "/usr/local/bin/python2"
143143

144+
# Required for V8 builds
145+
- name: rhel8 | update python package alternatives
146+
community.general.alternatives:
147+
link: /usr/bin/python
148+
name: python
149+
path: /usr/bin/python2
150+
when:
151+
- os == "rhel8"
152+
- build_test_v8|default(False)
153+
144154
- name: smartos17 | update gcc symlinks
145155
when: os == "smartos17"
146156
file:
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
3+
# Red Hat Enterprise Linux 8
4+
5+
- name: install GPG key for EPEL 8
6+
become: yes
7+
ansible.builtin.rpm_key:
8+
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
9+
state: present
10+
11+
- name: install EPEL 8
12+
ansible.builtin.dnf:
13+
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
14+
state: present

ansible/roles/baselayout/vars/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ packages: {
144144
'gcc-c++,sudo,git,zip,unzip,iptables-services,GConf2-devel,openssl-devel,python3',
145145
],
146146

147+
rhel8_s390x: [
148+
'GConf2-devel,python2' # Needed for V8 builds
149+
],
150+
151+
rhel8: [
152+
'ccache,cmake,gcc-c++,gcc-toolset-11,git,make,python3',
153+
],
154+
147155
smartos: [
148156
'gccmakedep',
149157
'git',
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: restart iptables
2+
ansible.builtin.service:
3+
name: iptables
4+
state: restarted

ansible/roles/bootstrap/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
loop_var: bootstrap_include
1111
with_first_found:
1212
- files:
13+
- "{{ role_path }}/tasks/partials/{{ os }}-{{ arch }}.yml"
1314
- "{{ role_path }}/tasks/partials/{{ os }}.yml"
1415
- "{{ role_path }}/tasks/partials/{{ os|stripversion }}.yml"
1516
skip: true
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
3+
# Red Hat Enterprise Linux 8 on s390x (LinuxONE)
4+
5+
- name: run common RHEL 8 tasks
6+
ansible.builtin.include_tasks: rhel8.yml
7+
8+
- name: Firewall | install iptables-services
9+
ansible.builtin.dnf:
10+
name: iptables-services
11+
state: present
12+
13+
- name: Firewall | enable iptables
14+
ansible.builtin.systemd:
15+
enabled: yes
16+
name: iptables
17+
18+
- name: Firewall | remove firewalld
19+
ansible.builtin.dnf:
20+
name: firewalld
21+
state: absent
22+
23+
- name: Firewall | add rule to allow accepting multicast
24+
lineinfile:
25+
dest: /etc/sysconfig/iptables
26+
insertafter: ":OUTPUT ACCEPT.*]"
27+
line: "-A INPUT -m pkttype --pkt-type multicast -j ACCEPT"
28+
notify: restart iptables
29+
30+
- name: Firewall | add basic rule to allow communication locally
31+
lineinfile:
32+
dest: /etc/sysconfig/iptables
33+
insertafter: ":OUTPUT ACCEPT.*]"
34+
line: "-A INPUT -s 127.0.0.1/32 -d 127.0.0.1/32 -j ACCEPT"
35+
notify: restart iptables
36+
37+
- name: Firewall | add additional rule to allow communication from 127.0.0.2
38+
lineinfile:
39+
dest: /etc/sysconfig/iptables
40+
insertafter: ":OUTPUT ACCEPT.*]"
41+
line: "-A INPUT -s 127.0.0.2/32 -d 127.0.0.1/32 -j ACCEPT"
42+
notify: restart iptables
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
3+
# Red Hat Enterprise Linux 8
4+
5+
- name: register Red Hat subscription
6+
community.general.redhat_subscription:
7+
activationkey: "{{ type }}"
8+
org_id: "{{ rh_org }}"
9+
state: present

0 commit comments

Comments
 (0)