diff --git a/defaults/main.yml b/defaults/main.yml index 607f965..aedbd2c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/variables.yml b/tasks/variables.yml index 47ce361..8293d27 100644 --- a/tasks/variables.yml +++ b/tasks/variables.yml @@ -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: diff --git a/tests/tasks/restore.yml b/tests/tasks/restore.yml index 386f3d2..e8130e8 100644 --- a/tests/tasks/restore.yml +++ b/tests/tasks/restore.yml @@ -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 diff --git a/vars/common.yml b/vars/common.yml new file mode 100644 index 0000000..cefd211 --- /dev/null +++ b/vars/common.yml @@ -0,0 +1,7 @@ +__sshd_skip_virt_env: + - kvm + - docker + - podman + - container + - containerd + - VirtualPC