Move the common variables to separate file

This commit is contained in:
Jakub Jelen 2022-04-12 12:18:24 +02:00 committed by Jakub Jelen
parent bcbdf92182
commit c515ffdf94
4 changed files with 13 additions and 16 deletions

View file

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

View file

@ -1,4 +1,7 @@
---
- name: Set common vars
include_vars: vars/common.yml
- name: Set OS dependent variables
include_vars: "{{ lookup('first_found', params) }}"
vars:

View file

@ -25,19 +25,14 @@
- __sshd_test_backup is defined
- __sshd_test_backup.path is defined
- name: Include common variables
include_vars: ../../vars/common.yml
- name: Restart sshd service
service:
name: sshd
state: reloaded
changed_when: false
vars:
__sshd_skip_virt_env:
- kvm
- docker
- podman
- container
- containerd
- VirtualPC
when:
- __sshd_test_backup is defined
- ansible_virtualization_type|default(None) not in __sshd_skip_virt_env

7
vars/common.yml Normal file
View file

@ -0,0 +1,7 @@
__sshd_skip_virt_env:
- kvm
- docker
- podman
- container
- containerd
- VirtualPC