mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-11-09 21:23:29 +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
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue