Skip to content

Commit a166af1

Browse files
committed
ansible: add RHEL 8
Extend Ansible and Jenkins scripts for Red Hat Enterprise Linux 8.
1 parent 4496f5b commit a166af1

File tree

18 files changed

+162
-4
lines changed

18 files changed

+162
-4
lines changed

ansible/inventory.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ hosts:
152152
rhel7-s390x-2: {ip: 148.100.86.117, user: linux1, build_test_v8: yes}
153153
rhel7-s390x-3: {ip: 148.100.86.28, user: linux1, build_test_v8: yes}
154154
rhel7-s390x-4: {ip: 148.100.86.94, user: linux1, build_test_v8: yes}
155+
rhel8-s390x-1: {ip: 148.100.84.112, user: linux1, build_test_v8: yes}
156+
rhel8-s390x-2: {ip: 148.100.84.240, user: linux1, build_test_v8: yes}
157+
rhel8-s390x-3: {ip: 148.100.84.56, user: linux1, build_test_v8: yes}
155158
ubuntu1804-x64-1: {ip: 52.117.26.14, alias: jenkins-workspace-6}
156159
ubuntu1804-x64-2: {ip: 50.97.245.9}
157160

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

ansible/roles/gn/tasks/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
ansible.builtin.git:
99
dest: "{{ gn_git_dir }}"
1010
repo: "https://gn.googlesource.com/gn"
11+
version: "{{ gn_version|default(omit) }}"
1112
become: "{{ gn_user|default(omit)|bool }}"
1213
become_user: "{{ gn_user|default(omit) }}"
1314
register: gn_git
@@ -23,7 +24,7 @@
2324
- name: build gn
2425
ansible.builtin.shell: |
2526
python3 build/gen.py && \
26-
. /opt/rh/devtoolset-8/enable && \
27+
{{ gn_select_compiler }} && \
2728
{{ gn_dest_dir }}/ninja -C out && \
2829
out/gn_unittests
2930
args:

ansible/roles/gn/vars/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
3+
compiler: {
4+
'centos7': '. /opt/rh/devtoolset-8/enable',
5+
'rhel7': '. /opt/rh/devtoolset-8/enable',
6+
'rhel8': '. /opt/rh/gcc-toolset-11/enable'
7+
}
8+
9+
gn_select_compiler: "{{ compiler[os]|default(compiler[os|stripversion])|default('true') }}"
10+
# Pin gn for now so we can still build older versions of V8 in Node.js 14.
11+
# Refs: https://github.com/nodejs/node/pull/40689#issuecomment-956303875
12+
gn_version: 69ec4fc

0 commit comments

Comments
 (0)