ssh.yml 424 B

12345678910111213141516171819
  1. ---
  2. - name: Update SSH configuration
  3. replace: >
  4. dest=/etc/ssh/sshd_config
  5. regexp="^([\#\s]*)?{{item.key}}\s+([\w_-]+)"
  6. replace="{{item.key}} {{item.value}}"
  7. backup=yes
  8. with_items:
  9. - key: PermitRootLogin
  10. value: 'without-password'
  11. - key: PasswordAuthentication
  12. value: 'no'
  13. - key: ChallengeResponseAuthentication
  14. value: 'no'
  15. - key: PrintLastLog
  16. value: 'no'
  17. notify:
  18. - reload ssh