Restore task naming consistency
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
# next task requires this directory to exist for sshd -t flag
|
# next task requires this directory to exist for sshd -t flag
|
||||||
- name: Ensure /run/sshd exists
|
- name: "Algorithms | Ensure /run/sshd exists"
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /run/sshd
|
path: /run/sshd
|
||||||
state: directory
|
state: directory
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: "Authentication | Configure SSH authentication settings"
|
- name: "Authentication | configure SSH authentication settings"
|
||||||
notify: "Restart ssh"
|
notify: "Restart ssh"
|
||||||
loop:
|
loop:
|
||||||
- { regexp: '^#?\s*PubkeyAuthentication\s+', line: 'PubkeyAuthentication yes' }
|
- { regexp: '^#?\s*PubkeyAuthentication\s+', line: 'PubkeyAuthentication yes' }
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
line: "{{ item.line }}"
|
line: "{{ item.line }}"
|
||||||
validate: /usr/sbin/sshd -t -f %s
|
validate: /usr/sbin/sshd -t -f %s
|
||||||
|
|
||||||
- name: "Check if there is an SSH config forced by cloud-init"
|
- name: "Authentication | check if there is an SSH config forced by cloud-init"
|
||||||
register: sshd_cloud_init
|
register: sshd_cloud_init
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "/etc/ssh/sshd_config.d/50-cloud-init.conf"
|
path: "/etc/ssh/sshd_config.d/50-cloud-init.conf"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
name: openssh-server
|
name: openssh-server
|
||||||
state: installed
|
state: installed
|
||||||
|
|
||||||
- name: "Install | Install OpenSSH server (Debian flavours)"
|
- name: "Install | install OpenSSH server (Debian flavours)"
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_os_family == "Debian"
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: openssh-server
|
name: openssh-server
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: "Restrictions | Configure SSH security restrictions"
|
- name: "Restrictions | configure SSH security restrictions"
|
||||||
loop:
|
loop:
|
||||||
- { regexp: '^#?Protocol\s+', line: 'Protocol 2' }
|
- { regexp: '^#?Protocol\s+', line: 'Protocol 2' }
|
||||||
- { regexp: '^#?\s*PermitRootLogin\s+', line: 'PermitRootLogin no' }
|
- { regexp: '^#?\s*PermitRootLogin\s+', line: 'PermitRootLogin no' }
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: "Configure AllowUsers"
|
- name: "Whitelists | configure AllowUsers"
|
||||||
when: sshd_allow_users is defined
|
when: sshd_allow_users is defined
|
||||||
notify: "Restart ssh"
|
notify: "Restart ssh"
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
line: "AllowUsers {{ sshd_allow_users }}"
|
line: "AllowUsers {{ sshd_allow_users }}"
|
||||||
validate: /usr/sbin/sshd -t -f %s
|
validate: /usr/sbin/sshd -t -f %s
|
||||||
|
|
||||||
- name: "Configure AllowGroups"
|
- name: "Whitelists | configure AllowGroups"
|
||||||
when: sshd_allow_groups is defined
|
when: sshd_allow_groups is defined
|
||||||
notify: "Restart ssh"
|
notify: "Restart ssh"
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
|
|||||||
Reference in New Issue
Block a user