added conjunctive test case for root to task conditional and fixed copy module's valdation string argument
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
---
|
||||
# tasks file for roles/init-vps
|
||||
- name: Checking whether administrative login used
|
||||
when: ansible_user not in (admins | map(attribute="username") | list)
|
||||
when: ansible_user not in (admins | map(attribute="username") | list) and ansible_user != "root"
|
||||
ansible.builtin.fail:
|
||||
msg: Must use administrative user for subsequent tasks
|
||||
- name: Hardening SSH service for the Linode VPS
|
||||
@@ -14,5 +14,5 @@
|
||||
mode: "644"
|
||||
force: true
|
||||
backup: true
|
||||
validate: "sshd -t %s"
|
||||
validate: 'sshd -t -f %s'
|
||||
register: ssh_hardened
|
||||
Reference in New Issue
Block a user