diff --git a/handlers/main.yml b/handlers/main.yml index 2a437b4..ba6b8b7 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,7 +1,10 @@ --- + - name: Reload the SSH service service: name: "{{ sshd_service }}" state: reloaded - when: "sshd_allow_reload and ansible_virtualization_type|default(None) != 'docker'" + when: + - sshd_allow_reload + - ansible_virtualization_type|default(None) != 'docker' listen: reload_sshd diff --git a/tasks/install.yml b/tasks/install.yml index 3a04046..f7127c9 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -2,13 +2,12 @@ - name: OS is supported assert: - that: __sshd_os_supported == True + that: '__sshd_os_supported == True' - name: Install ssh packages package: - name: "{{ item }}" + name: "{{ sshd_packages }}" state: present - with_items: "{{ sshd_packages }}" - name: Configuration template: @@ -44,5 +43,6 @@ when: "sshd_manage_service and ansible_virtualization_type|default(None) != 'docker'" - name: Register that this role has run - set_fact: sshd_has_run=true + set_fact: + sshd_has_run: true when: sshd_has_run is not defined diff --git a/tasks/variables.yml b/tasks/variables.yml index 90ea62a..e59cb4e 100644 --- a/tasks/variables.yml +++ b/tasks/variables.yml @@ -1,13 +1,14 @@ --- - name: Set OS dependent variables - include_vars: "{{ item }}" - with_first_found: - - "{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml" - - "{{ ansible_distribution }}.yml" - - "{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml" - - "{{ ansible_os_family }}.yml" - - default.yml + include_vars: "{{ lookup('first_found', var_files) }}" + vars: + var_files: + - "{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml" + - "{{ ansible_distribution }}.yml" + - "{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml" + - "{{ ansible_os_family }}.yml" + - default.yml - name: Override OS defaults block: