Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
5f1aa6882d | |||
8080de211a | |||
dce0c63dcb |
|
@ -1,7 +1,18 @@
|
||||||
---
|
---
|
||||||
|
- 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»"
|
- name: "Set «PermitRootLogin» to «without-password»"
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/ssh/sshd_config
|
dest: '{{ sshd_config_path | default("/etc/ssh/sshd_config") }}'
|
||||||
regexp: '^#? *PermitRootLogin'
|
regexp: '^#? *PermitRootLogin'
|
||||||
line: "PermitRootLogin without-password"
|
line: "PermitRootLogin without-password"
|
||||||
backup: yes
|
backup: yes
|
||||||
|
@ -12,7 +23,6 @@
|
||||||
service:
|
service:
|
||||||
name: "{{ ssh_service_name }}"
|
name: "{{ ssh_service_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
sleep: 5
|
|
||||||
when: sshconfigchanged is changed
|
when: sshconfigchanged is changed
|
||||||
|
|
||||||
|
|
||||||
|
|
3
vars/debian.yml
Normal file
3
vars/debian.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
ssh_service_name: ssh
|
||||||
|
|
3
vars/default.yml
Normal file
3
vars/default.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
ssh_service_name: sshd
|
||||||
|
|
1
vars/devuan.yml
Symbolic link
1
vars/devuan.yml
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
debian.yml
|
Loading…
Reference in a new issue