mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-11-29 06:00:19 +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
|
- name: Reload the SSH service
|
||||||
service:
|
service:
|
||||||
name: "{{ sshd_service }}"
|
name: "{{ sshd_service }}"
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
|
|
||||||
- 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:
|
||||||
|
@ -59,5 +58,6 @@
|
||||||
- ansible_distribution_major_version|int >= 7
|
- ansible_distribution_major_version|int >= 7
|
||||||
|
|
||||||
- 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,17 +1,19 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Set OS dependent variables
|
- name: Set OS dependent variables
|
||||||
include_vars: "{{ item }}"
|
include_vars: "{{ lookup('first_found', params) }}"
|
||||||
vars:
|
vars:
|
||||||
ansible_distribution_lts_offset: '{{
|
ansible_distribution_lts_offset: >-
|
||||||
ansible_distribution_major_version|int % 2
|
{{
|
||||||
if ansible_distribution == "Ubuntu"
|
ansible_distribution_major_version|int % 2
|
||||||
else 0 }}'
|
if ansible_distribution == "Ubuntu"
|
||||||
|
else 0
|
||||||
|
}}
|
||||||
ansible_distribution_lts_version: '{{
|
ansible_distribution_lts_version: '{{
|
||||||
ansible_distribution_major_version|int -
|
ansible_distribution_major_version|int -
|
||||||
ansible_distribution_lts_offset|int }}'
|
ansible_distribution_lts_offset|int }}'
|
||||||
with_first_found:
|
params:
|
||||||
- files:
|
files:
|
||||||
- "{{ ansible_distribution }}_{{ ansible_distribution_lts_version }}.yml"
|
- "{{ ansible_distribution }}_{{ ansible_distribution_lts_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