ssh.yml 479 B

12345678910111213141516
  1. - name: Install ssh packages
  2. action: ${ansible_pkg_mgr} pkg=${item} state=installed update_cache=yes
  3. with_items:
  4. - openssh-server
  5. - openssh-client
  6. when_boolean: ${with_ssh}
  7. - name: Install sshd configuration
  8. action: template src=ssh/sshd_config.j2 dest=/etc/ssh/sshd_config owner=root group=root mode=0644
  9. notify:
  10. - Restart ssh
  11. when_boolean: ${with_ssh}
  12. - name: Ensure ssh is running
  13. action: service name=ssh state=started
  14. when_boolean: ${with_ssh}