mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-11-13 23:10:19 +01:00
70808e97fc
Use `true/false` instead of `yes/no` Ensure use of FQCN for builtin modules Use correct spacing in Jinja expressions All tasks and plays must have a `name`, and the `name` string must begin with an uppercase letter Use `ansible.posix.mount` instead of `ansible.builtin.mount` Use `set -o pipefail` with `shell` module where supported by the platform shell Signed-off-by: Rich Megginson <rmeggins@redhat.com>
16 lines
533 B
YAML
16 lines
533 B
YAML
---
|
|
- name: Manage root login
|
|
hosts: all
|
|
tasks:
|
|
- name: Configure sshd to prevent root and password login except from particular subnet
|
|
ansible.builtin.include_role:
|
|
name: ansible-sshd
|
|
vars:
|
|
sshd:
|
|
# root login and password login is enabled only from a particular subnet
|
|
PermitRootLogin: false
|
|
PasswordAuthentication: false
|
|
Match:
|
|
- Condition: "Address 192.0.2.0/24"
|
|
PermitRootLogin: true
|
|
PasswordAuthentication: true
|