mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-11-28 05:40:19 +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
|
- 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:
|
block:
|
||||||
- name: Install service unit file
|
- name: Install service unit file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
|
@ -34,7 +34,8 @@
|
||||||
- name: Read the service files and verify they are reasonable
|
- name: Read the service files and verify they are reasonable
|
||||||
tags: tests::verify
|
tags: tests::verify
|
||||||
when:
|
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:
|
block:
|
||||||
- name: Read the distribution service file
|
- name: Read the distribution service file
|
||||||
ansible.builtin.slurp:
|
ansible.builtin.slurp:
|
||||||
|
@ -114,7 +115,8 @@
|
||||||
- name: Read the instantiated service file and verify they are reasonable
|
- name: Read the instantiated service file and verify they are reasonable
|
||||||
tags: tests::verify
|
tags: tests::verify
|
||||||
when:
|
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
|
- ansible_facts['distribution'] != "Debian" or ansible_facts['distribution_major_version'] | int < 12
|
||||||
block:
|
block:
|
||||||
- name: Read the distribution instantiated service file
|
- name: Read the distribution instantiated service file
|
||||||
|
@ -154,6 +156,5 @@
|
||||||
that:
|
that:
|
||||||
- "' -f /etc/ssh/' in service_inst.content | b64decode"
|
- "' -f /etc/ssh/' in service_inst.content | b64decode"
|
||||||
|
|
||||||
|
|
||||||
- name: "Restore configuration files"
|
- name: "Restore configuration files"
|
||||||
ansible.builtin.include_tasks: tasks/restore.yml
|
ansible.builtin.include_tasks: tasks/restore.yml
|
||||||
|
|
Loading…
Reference in a new issue