2022-04-06 20:51:15 +02:00
|
|
|
name: Run Ansible Check on CentOS
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
centos-6:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-04-11 17:35:44 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-04-06 20:51:15 +02:00
|
|
|
|
|
|
|
# Workaround missing support for end_host in old ansible
|
|
|
|
- run: "sed -i -e 's/meta: end_host/assert:\\n that: __sshd_os_supported|bool/' tasks/install.yml"
|
2022-08-19 18:36:01 +02:00
|
|
|
- run: >-
|
|
|
|
printf '%s\n%s\n%s\n%s'
|
|
|
|
'- name: Convert variables to facts for testing with old Ansible version (pre 2.7)'
|
|
|
|
' ansible.builtin.set_fact:'
|
|
|
|
' __sshd_skip_virt_env: "{{ __sshd_skip_virt_env }}"'
|
|
|
|
' __sshd_config_file: "{{ __sshd_config_file }}"'
|
|
|
|
>> tasks/variables.yml
|
2022-08-17 16:34:35 +02:00
|
|
|
- run: >-
|
|
|
|
sed -i -e '/public: true/d'
|
|
|
|
tests/tasks/restore.yml
|
|
|
|
tests/tests_duplicate_role.yml
|
|
|
|
tests/tests_os_defaults.yml
|
2023-04-26 23:22:29 +02:00
|
|
|
tests/tests_firewall_selinux.yml
|
2023-04-10 23:07:38 +02:00
|
|
|
- run: "sed -i -e 's/ansible.builtin.//g' -e 's/ansible.posix.//g' */*.yml */*/*.yml"
|
2022-04-06 20:51:15 +02:00
|
|
|
|
|
|
|
- name: ansible check with centos 6
|
|
|
|
uses: roles-ansible/check-ansible-centos-centos6-action@master
|
|
|
|
with:
|
|
|
|
group: local
|
|
|
|
hosts: localhost
|
|
|
|
targets: "tests/tests_*.yml"
|
|
|
|
|
|
|
|
centos-7:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout PR
|
2023-04-11 17:35:44 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-04-06 20:51:15 +02:00
|
|
|
|
2023-04-10 23:07:38 +02:00
|
|
|
- run: "sed -i -e 's/ansible.posix.//g' */*.yml */*/*.yml"
|
|
|
|
|
2022-04-06 20:51:15 +02:00
|
|
|
- name: ansible check with centos 7
|
|
|
|
uses: roles-ansible/check-ansible-centos-centos7-action@master
|
|
|
|
with:
|
|
|
|
group: local
|
|
|
|
hosts: localhost
|
|
|
|
targets: "tests/tests_*.yml"
|
|
|
|
|
|
|
|
centos-8:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout PR
|
2023-04-11 17:35:44 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-04-06 20:51:15 +02:00
|
|
|
|
|
|
|
- name: ansible check with centos 8
|
|
|
|
uses: roles-ansible/check-ansible-centos-centos8-action@master
|
|
|
|
with:
|
|
|
|
group: local
|
|
|
|
hosts: localhost
|
|
|
|
targets: "tests/tests_*.yml"
|
|
|
|
requirements: tests/requirements.yml
|
|
|
|
|
|
|
|
centos-9:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout PR
|
2023-04-11 17:35:44 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-04-06 20:51:15 +02:00
|
|
|
|
|
|
|
- name: ansible check with centos 9
|
|
|
|
uses: roles-ansible/check-ansible-centos-centos9-action@main
|
|
|
|
with:
|
|
|
|
group: local
|
|
|
|
hosts: localhost
|
|
|
|
targets: "tests/tests_*.yml"
|
|
|
|
requirements: tests/requirements.yml
|