Reuse the list of skipped virtualization environments

This commit is contained in:
Jakub Jelen 2022-04-11 19:36:03 +02:00 committed by Jakub Jelen
parent 7e311e19a9
commit c1d1cdfeac
4 changed files with 19 additions and 18 deletions

View file

@ -81,3 +81,11 @@ __sshd_sysconfig_supports_use_strong_rng: false
__sshd_runtime_directory: false __sshd_runtime_directory: false
__sshd_runtime_directory_mode: "0755" __sshd_runtime_directory_mode: "0755"
__sshd_skip_virt_env:
- kvm
- docker
- podman
- container
- containerd
- VirtualPC

View file

@ -6,12 +6,7 @@
state: reloaded state: reloaded
when: when:
- sshd_allow_reload|bool - sshd_allow_reload|bool
- ansible_virtualization_type|default(None) != 'kvm' - ansible_virtualization_type|default(None) not in __sshd_skip_virt_env
- ansible_virtualization_type|default(None) != 'docker'
- ansible_virtualization_type|default(None) != 'podman'
- ansible_virtualization_type|default(None) != 'container'
- ansible_virtualization_type|default(None) != 'containerd'
- ansible_virtualization_type|default(None) != 'VirtualPC' # for Github Actions
- ansible_connection != 'chroot' - ansible_connection != 'chroot'
- ansible_os_family != 'AIX' - ansible_os_family != 'AIX'
listen: reload_sshd listen: reload_sshd

View file

@ -217,12 +217,7 @@
state: started state: started
when: when:
- sshd_manage_service|bool - sshd_manage_service|bool
- ansible_virtualization_type|default(None) != 'kvm' - ansible_virtualization_type|default(None) not in __sshd_skip_virt_env
- ansible_virtualization_type|default(None) != 'docker'
- ansible_virtualization_type|default(None) != 'podman'
- ansible_virtualization_type|default(None) != 'container'
- ansible_virtualization_type|default(None) != 'containerd'
- ansible_virtualization_type|default(None) != 'VirtualPC' # for Github Actions
- ansible_connection != 'chroot' - ansible_connection != 'chroot'
# Due to ansible bug 21026, cannot use service module on RHEL 7 # Due to ansible bug 21026, cannot use service module on RHEL 7

View file

@ -30,13 +30,16 @@
name: sshd name: sshd
state: reloaded state: reloaded
changed_when: false changed_when: false
vars:
__sshd_skip_virt_env:
- kvm
- docker
- podman
- container
- containerd
- VirtualPC
when: when:
- __sshd_test_backup is defined - __sshd_test_backup is defined
- ansible_virtualization_type|default(None) != 'kvm' - ansible_virtualization_type|default(None) not in __sshd_skip_virt_env
- ansible_virtualization_type|default(None) != 'docker'
- ansible_virtualization_type|default(None) != 'podman'
- ansible_virtualization_type|default(None) != 'container' # new podman
- ansible_virtualization_type|default(None) != 'containerd'
- ansible_virtualization_type|default(None) != 'VirtualPC' # for Github Actions
- ansible_connection != 'chroot' - ansible_connection != 'chroot'
- ansible_os_family != 'AIX' - ansible_os_family != 'AIX'