---
- include: sshd.yml
  sudo: true
  when: secure_ssh
- include: firewalld.yml
  sudo: true
  when: secure_firewalld
- include: fail2ban.yml
  sudo: true
  when: secure_fail2ban

# ipv6? Check it if you have it.
- include: ipv6.yml
  sudo: true
  when: ansible_default_ipv6 != {} and secure_ipv6

- file: path=~/.ssh state=directory mode=0700
- name: add authorized keys
  copy: content="{{ authorized_keys }}"
        dest=~/.ssh/authorized_keys
        backup=true
        mode=0600

---
- include: sshd.yml
  sudo: true
  when: secure_ssh
- include: firewalld.yml
  sudo: true
  when: secure_firewalld
- include: fail2ban.yml
  sudo: true
  when: secure_fail2ban

# ipv6? Check it if you have it.
- include: ipv6.yml
  sudo: true
  when: ansible_default_ipv6 != {} and secure_ipv6

- file: path=~/.ssh state=directory mode=0700
- name: add authorized keys
  copy: content="{{ authorized_keys }}"
        dest=~/.ssh/authorized_keys
        backup=true
        mode=0600

- file: path=/root/.ssh state=directory mode=0700 user=root group=root
- name: add authorized keys
  copy: content="{{ authorized_keys }}"
        dest=/root/.ssh/authorized_keys
        backup=true
        mode=0600
        user=root
        group=root

Add ssh keys to root user as well
Add ssh keys to root user as well
