mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-12-25 18:10:18 +01:00
Merge pull request #92 from nkakouros-forks/syntax
Updates syntax to Ansible 2.7 era
This commit is contained in:
commit
003480d7b6
3 changed files with 13 additions and 10 deletions
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: Reload the SSH service
|
||||
service:
|
||||
name: "{{ sshd_service }}"
|
||||
|
|
|
@ -6,9 +6,8 @@
|
|||
|
||||
- name: Install ssh packages
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
name: "{{ sshd_packages }}"
|
||||
state: present
|
||||
with_items: "{{ sshd_packages }}"
|
||||
|
||||
- name: Configuration
|
||||
template:
|
||||
|
@ -59,5 +58,6 @@
|
|||
- ansible_distribution_major_version|int >= 7
|
||||
|
||||
- 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,17 +1,19 @@
|
|||
---
|
||||
|
||||
- name: Set OS dependent variables
|
||||
include_vars: "{{ item }}"
|
||||
include_vars: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
ansible_distribution_lts_offset: '{{
|
||||
ansible_distribution_major_version|int % 2
|
||||
if ansible_distribution == "Ubuntu"
|
||||
else 0 }}'
|
||||
ansible_distribution_lts_offset: >-
|
||||
{{
|
||||
ansible_distribution_major_version|int % 2
|
||||
if ansible_distribution == "Ubuntu"
|
||||
else 0
|
||||
}}
|
||||
ansible_distribution_lts_version: '{{
|
||||
ansible_distribution_major_version|int -
|
||||
ansible_distribution_lts_offset|int }}'
|
||||
with_first_found:
|
||||
- files:
|
||||
params:
|
||||
files:
|
||||
- "{{ ansible_distribution }}_{{ ansible_distribution_lts_version }}.yml"
|
||||
- "{{ ansible_distribution }}.yml"
|
||||
- "{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml"
|
||||
|
|
Loading…
Reference in a new issue