geerlingguy / ansible-role-security

Ansible Role - Security

Home Page:https://galaxy.ansible.com/geerlingguy/security/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add sshd_config file validation in lineinfile task

geerlingguy opened this issue · comments

See: https://www.youtube.com/watch?v=gV_16dU7XjM

And see related issue from my book, Ansible for DevOps: geerlingguy/ansible-for-devops#273

The line to add: validate: 'sshd -t -f %s' (see note on -T vs -t in man docs, as mentioned by @KaliszAd).