diff --git a/tasks/main.yml b/tasks/main.yml index da66e83..4211bc4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,20 +1,20 @@ --- +- name: combine sshd variable + set_fact: + sshd: "{{ _sshd|combine(sshd, recursive=True) }}" + - include_tasks: versioncheck.yml when: submodules_versioncheck|bool -- name: register os-specific variables - include_vars: vars/default.yml - when: - - ansible_distribution != 'Fedora' - - ansible_distribution != 'Archlinux' - - ansible_distribution != 'CentOS' +- name: set sshd_service variable + block: + - name: read os specific variable + include_vars: "vars/{{ ansible_distribution | lower }}.yml" + rescue: + - name: read default variable + include_vars: vars/default.yml -- name: register os-specific variables - include_vars: "vars/{{ ansible_distribution | lower }}.yml" - when: - - ansible_distribution == 'Fedora' - - ansible_distribution == 'Archlinux' - - ansible_distribution == 'CentOS' +- pause: - name: Collect all users and groups allowed to login via ssh set_fact: diff --git a/vars/archlinux.yml b/vars/archlinux.yml index 164876b..a24e2b4 100644 --- a/vars/archlinux.yml +++ b/vars/archlinux.yml @@ -1,2 +1,2 @@ --- -ssh_service: sshd +sshd_service: sshd diff --git a/vars/centos.yml b/vars/centos.yml index 164876b..a24e2b4 100644 --- a/vars/centos.yml +++ b/vars/centos.yml @@ -1,2 +1,2 @@ --- -ssh_service: sshd +sshd_service: sshd diff --git a/vars/default.yml b/vars/default.yml index 199a5d8..2cb66f3 100644 --- a/vars/default.yml +++ b/vars/default.yml @@ -1,2 +1,2 @@ --- -ssh_service: ssh +sshd_service: ssh diff --git a/vars/fedora.yml b/vars/fedora.yml index 164876b..a24e2b4 100644 --- a/vars/fedora.yml +++ b/vars/fedora.yml @@ -1,2 +1,2 @@ --- -ssh_service: sshd +sshd_service: sshd