Read OS dependent vars

This commit is contained in:
Sven Velt 2019-05-07 10:19:57 +02:00
parent 6f93842670
commit dce0c63dcb
5 changed files with 21 additions and 0 deletions

View file

@ -1,4 +1,15 @@
---
- name: Gather OS specific variables
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution|lower }}.yml"
- "{{ ansible_lsb.id|default('NotAvailable')|lower }}.yml"
- "{{ (ansible_os_family|lower).split(' ')[0] }}.yml"
- "default.yml"
- name: "Set «PermitRootLogin» to «without-password»"
lineinfile:
dest: /etc/ssh/sshd_config

3
vars/debian.yml Normal file
View file

@ -0,0 +1,3 @@
---
ssh_service_name: ssh

1
vars/devuan.yml Symbolic link
View file

@ -0,0 +1 @@
debian.yml

3
vars/redhat.yml Normal file
View file

@ -0,0 +1,3 @@
---
ssh_service_name: sshd

3
vars/suse.yml Normal file
View file

@ -0,0 +1,3 @@
---
ssh_service_name: sshd