---
- 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 owner=root group=root
  sudo: true
- name: add authorized keys
  sudo: true
  copy: content="{{ authorized_keys }}"
        dest=/root/.ssh/authorized_keys
        backup=true
        mode=0600
        owner=root
        group=root

---
- 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

- name: Add SSH keys from github
  authorized_key: user=ryansb key=https://github.com/ryansb.keys
  when: not undercloud

- name: Add root SSH keys
  authorized_key: user=root key=https://github.com/ryansb.keys
  sudo: true

Use authorized_keys module instead of manipulating files directly
Use authorized_keys module instead of manipulating files directly
