Files
gitlab-mirror/roles/sshd/tasks/whitelists.yml
2026-06-08 14:17:10 +04:00

19 lines
576 B
YAML

---
- name: "Whitelists | configure AllowUsers"
when: sshd_allow_users is defined
notify: "Restart ssh"
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '^#?\s*AllowUsers\s+'
line: "AllowUsers {{ sshd_allow_users }}"
validate: /usr/sbin/sshd -t -f %s
- name: "Whitelists | configure AllowGroups"
when: sshd_allow_groups is defined
notify: "Restart ssh"
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '^#?\s*AllowGroups\s+'
line: "AllowGroups {{ sshd_allow_groups }}"
validate: /usr/sbin/sshd -t -f %s