-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. Refs: #2741 Refs: #2815
- Loading branch information
1 parent
472b295
commit 7c82a22
Showing
26 changed files
with
231 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
|
||
# Red Hat Enterprise Linux 8 | ||
|
||
- name: install GPG key for EPEL 8 | ||
become: yes | ||
ansible.builtin.rpm_key: | ||
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8 | ||
state: present | ||
|
||
- name: install EPEL 8 | ||
ansible.builtin.dnf: | ||
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- name: restart iptables | ||
ansible.builtin.service: | ||
name: iptables | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
|
||
# Red Hat Enterprise Linux 8 on s390x (LinuxONE) | ||
|
||
- name: run common RHEL 8 tasks | ||
ansible.builtin.include_tasks: rhel8.yml | ||
|
||
- name: Firewall | install iptables-services | ||
ansible.builtin.dnf: | ||
name: iptables-services | ||
state: present | ||
|
||
- name: Firewall | enable iptables | ||
ansible.builtin.systemd: | ||
enabled: yes | ||
name: iptables | ||
|
||
- name: Firewall | remove firewalld | ||
ansible.builtin.dnf: | ||
name: firewalld | ||
state: absent | ||
|
||
- name: Firewall | add rule to allow accepting multicast | ||
lineinfile: | ||
dest: /etc/sysconfig/iptables | ||
insertafter: ":OUTPUT ACCEPT.*]" | ||
line: "-A INPUT -m pkttype --pkt-type multicast -j ACCEPT" | ||
notify: restart iptables | ||
|
||
- name: Firewall | add basic rule to allow communication locally | ||
lineinfile: | ||
dest: /etc/sysconfig/iptables | ||
insertafter: ":OUTPUT ACCEPT.*]" | ||
line: "-A INPUT -s 127.0.0.1/32 -d 127.0.0.1/32 -j ACCEPT" | ||
notify: restart iptables | ||
|
||
- name: Firewall | add additional rule to allow communication from 127.0.0.2 | ||
lineinfile: | ||
dest: /etc/sysconfig/iptables | ||
insertafter: ":OUTPUT ACCEPT.*]" | ||
line: "-A INPUT -s 127.0.0.2/32 -d 127.0.0.1/32 -j ACCEPT" | ||
notify: restart iptables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
|
||
# Red Hat Enterprise Linux 8 | ||
|
||
- name: register Red Hat subscription | ||
community.general.redhat_subscription: | ||
activationkey: "{{ type }}" | ||
org_id: "{{ rh_org }}" | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
|
||
compiler: { | ||
'centos7': '. /opt/rh/devtoolset-8/enable', | ||
'rhel7': '. /opt/rh/devtoolset-8/enable', | ||
'rhel8': '. /opt/rh/gcc-toolset-11/enable' | ||
} | ||
|
||
gn_select_compiler: "{{ compiler[os]|default(compiler[os|stripversion])|default('true') }}" | ||
# Pin gn for now so we can still build older versions of V8 in Node.js 14. | ||
# Refs: https://github.com/nodejs/node/pull/40689#issuecomment-956303875 | ||
gn_version: 69ec4fc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
|
||
# | ||
# generic handlers for jenkins-worker | ||
# | ||
|
||
- name: restart Jenkins | ||
ansible.builtin.service: | ||
name: jenkins | ||
state: restarted | ||
when: | ||
- not os|startswith("aix") | ||
- not os|startswith("ibmi") | ||
- not os|startswith("macos") | ||
- not os|startswith("zos") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Host node-www | ||
HostName direct.nodejs.org | ||
User staging | ||
IdentityFile ~/.ssh/id_rsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
|
||
argument_specs: | ||
main: | ||
short_description: Set up specific to hosts that build releases. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
|
||
dependencies: | ||
- role: user-create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
|
||
# Set up release hosts to be able to upload to the staging server. | ||
# Requires access to the secrets repository. User should have already | ||
# been prompted for GPG credentials during the inventory load. | ||
|
||
- name: create .ssh directory | ||
ansible.builtin.file: | ||
dest: "{{ home }}/{{ server_user }}/.ssh" | ||
mode: "0700" | ||
owner: "{{ server_user }}" | ||
group: "{{ server_user }}" | ||
state: directory | ||
|
||
- name: copy key to access staging server | ||
ansible.builtin.copy: | ||
content: "{{ lookup('pipe', 'gpg -d ' + staging_key | quote) }}" | ||
dest: "{{ home }}/{{ server_user }}/.ssh/id_rsa" | ||
mode: "0600" | ||
owner: "{{ server_user }}" | ||
group: "{{ server_user }}" | ||
vars: | ||
staging_key: "{{ secrets_repo_root }}/build/release/staging_id_rsa_private.key" | ||
|
||
- name: write ssh_config | ||
ansible.builtin.copy: | ||
dest: "{{ home }}/{{ server_user }}/.ssh/config" | ||
src: "{{ role_path }}/files/ssh_config" | ||
mode: "0600" | ||
owner: "{{ server_user }}" | ||
group: "{{ server_user }}" | ||
|
||
- name: write known_hosts | ||
ansible.builtin.known_hosts: | ||
name: direct.nodejs.org | ||
key: "{{ lookup('pipe', 'gpg -d ' + known_hosts | quote) }}" | ||
path: "{{ home }}/{{ server_user }}/.ssh/known_hosts" | ||
state: present | ||
become: yes | ||
become_user: "{{ server_user }}" | ||
vars: | ||
known_hosts: "{{ secrets_repo_root }}/build/release/known_hosts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
|
||
# The path to the secrets repository. | ||
# See also `ansible/plugins/inventory/nodejs_yaml.py`. | ||
secrets_repo_root: "{{ lookup('env', 'NODE_BUILD_SECRETS')|default('../../../../../secrets', True) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.