add-build-sshkey: add centos/rhel-8 support

Assues we install libselinux on these platforms as otherwise Ansible
could choke with:

TASK [add-build-sshkey : Enable access via build key on all nodes]
"msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"

Change-Id: I91ec606b5b4e8dce7b71912fdc5890ac6aaf20ef
This commit is contained in:
Sorin Sbarnea 2019-08-01 18:02:47 +01:00
parent 8624201e0c
commit b4a7a11ccb
3 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1 @@
system_packages: []

View File

@ -1,3 +1,14 @@
- name: Include OS specific variables
include_vars: "{{ item }}"
failed_when: false
loop:
- "family-{{ ansible_os_family | lower }}.yml"
- "family-{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version.split('.')[0:2] | join('-') | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version.split('.')[0:3] | join('-') | lower }}.yml"
- name: Check to see if ssh key was already created for this build
stat:
path: "{{ zuul_temp_ssh_key }}"
@ -6,6 +17,11 @@
run_once: true
failed_when: false
- name: Install required packages
when: system_packages
package:
name: "{{ system_packages }}"
- name: Create a new key in workspace based on build UUID
include: create-key-and-replace.yaml
when:

View File

@ -0,0 +1,2 @@
system_packages:
- python3-libselinux