- name: Create .ssh directory
  file:
    path: "/home/{{ main_user.name }}/.ssh"
    state: directory
    mode: '0700'
    owner: "{{ main_user.name }}"
    group: users

- name: setup publc ssh key
  copy:
    dest: "/home/{{ main_user.name }}/.ssh/id_rsa.pub"
    content: "{{ ssh_pub }}"
    mode: "0644"
    owner: "{{ main_user.name }}"
    group: users

- name: setup private ssh key
  copy:
    dest: "/home/{{ main_user.name }}/.ssh/id_rsa"
    content: "{{ ssh_private }}"
    mode: "0600"
    owner: "{{ main_user.name }}"
    group: users

- name: setup publc VPN ssh key
  copy:
    dest: "/home/{{ main_user.name }}/.ssh/vpn.pub"
    content: "{{ ssh_vpn_pub }}"
    mode: "0644"
    owner: "{{ main_user.name }}"
    group: users

- name: setup private VPN ssh key
  copy:
    dest: "/home/{{ main_user.name }}/.ssh/vpn"
    content: "{{ ssh_vpn_private }}"
    mode: "0600"
    owner: "{{ main_user.name }}"
    group: users

- name: copy sshconfig
  copy:
    src: files/home/.ssh/config
    dest: "/home/{{ main_user.name }}/.ssh/"
    owner: root
    group: root
