ssh.yml 386 B

1234567891011121314151617
  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. notify:
  16. - reload ssh