mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-12-27 19:00:18 +01:00
Workaround for CentOS7 reporting ansible_facts['service_mgr'] == 'sysvinit' in containers
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
parent
e119c3fd28
commit
237e8b4255
2 changed files with 8 additions and 4 deletions
|
@ -1,6 +1,9 @@
|
|||
---
|
||||
- name: Install systemd service files
|
||||
when: sshd_install_service | bool and ansible_facts['service_mgr'] == 'systemd'
|
||||
when:
|
||||
- sshd_install_service | bool
|
||||
- ansible_facts['service_mgr'] == 'systemd' or
|
||||
(ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '7')
|
||||
block:
|
||||
- name: Install service unit file
|
||||
ansible.builtin.template:
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
- name: Read the service files and verify they are reasonable
|
||||
tags: tests::verify
|
||||
when:
|
||||
- ansible_facts['service_mgr'] == 'systemd'
|
||||
- ansible_facts['service_mgr'] == 'systemd' or
|
||||
(ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '7')
|
||||
block:
|
||||
- name: Read the distribution service file
|
||||
ansible.builtin.slurp:
|
||||
|
@ -114,7 +115,8 @@
|
|||
- name: Read the instantiated service file and verify they are reasonable
|
||||
tags: tests::verify
|
||||
when:
|
||||
- ansible_facts['service_mgr'] == 'systemd'
|
||||
- ansible_facts['service_mgr'] == 'systemd' or
|
||||
(ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '7')
|
||||
- ansible_facts['distribution'] != "Debian" or ansible_facts['distribution_major_version'] | int < 12
|
||||
block:
|
||||
- name: Read the distribution instantiated service file
|
||||
|
@ -154,6 +156,5 @@
|
|||
that:
|
||||
- "' -f /etc/ssh/' in service_inst.content | b64decode"
|
||||
|
||||
|
||||
- name: "Restore configuration files"
|
||||
ansible.builtin.include_tasks: tasks/restore.yml
|
||||
|
|
Loading…
Reference in a new issue