--- - name: openssh - install apt: name=openssh-server - name: openssh - start and enable service: name=ssh state=started enabled=yes - name: openssh - config template: dest: /etc/ssh/sshd_config src: sshd_config.j2 owner: root group: root mode: 0600 validate: '/usr/sbin/sshd -T -f %s' notify: reload openssh - name: openssh - root keys authorized_key: user=root key={{ common_openssh_keys_root | join("\n") }} exclusive=yes when: common_openssh_keys_root tags: 'ssh-keys' - name: openssh - host keys copy: src=known_hosts dest=/etc/ssh/ssh_known_hosts failed_when: false - name: openssh - truncate /etc/motd copy: dest=/etc/motd content='' force=yes