mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-12-23 17:10:19 +01:00
Updates syntax to Ansible 2.7 era
This commit is contained in:
parent
b431459b45
commit
10f94a1f05
3 changed files with 16 additions and 12 deletions
|
@ -1,7 +1,10 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Reload the SSH service
|
- name: Reload the SSH service
|
||||||
service:
|
service:
|
||||||
name: "{{ sshd_service }}"
|
name: "{{ sshd_service }}"
|
||||||
state: reloaded
|
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
|
listen: reload_sshd
|
||||||
|
|
|
@ -2,13 +2,12 @@
|
||||||
|
|
||||||
- name: OS is supported
|
- name: OS is supported
|
||||||
assert:
|
assert:
|
||||||
that: __sshd_os_supported == True
|
that: '__sshd_os_supported == True'
|
||||||
|
|
||||||
- name: Install ssh packages
|
- name: Install ssh packages
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ sshd_packages }}"
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ sshd_packages }}"
|
|
||||||
|
|
||||||
- name: Configuration
|
- name: Configuration
|
||||||
template:
|
template:
|
||||||
|
@ -44,5 +43,6 @@
|
||||||
when: "sshd_manage_service and ansible_virtualization_type|default(None) != 'docker'"
|
when: "sshd_manage_service and ansible_virtualization_type|default(None) != 'docker'"
|
||||||
|
|
||||||
- name: Register that this role has run
|
- 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
|
when: sshd_has_run is not defined
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Set OS dependent variables
|
- name: Set OS dependent variables
|
||||||
include_vars: "{{ item }}"
|
include_vars: "{{ lookup('first_found', var_files) }}"
|
||||||
with_first_found:
|
vars:
|
||||||
|
var_files:
|
||||||
- "{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml"
|
- "{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml"
|
||||||
- "{{ ansible_distribution }}.yml"
|
- "{{ ansible_distribution }}.yml"
|
||||||
- "{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml"
|
- "{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml"
|
||||||
|
|
Loading…
Reference in a new issue