- name: common-peering-local-account
  user:
    name: "peer"
    state: present
    skeleton: /etc/skel
    shell: /bin/bash
    system: no
    createhome: yes
    home: "/home/peers/self"


- name: common-peering-local-ln
  file:
    src: /home/peers/self
    dest: "/home/peers/{{ hostname }}"
    state: link

- file:
    path: /home/peers/self/.ssh
    owner: peer
    group: peer
    state: directory

- name: common-peering-local-genkey
  become: yes
  become_user: peer
  command:
    creates: /home/peers/self/.ssh/id_ed25519.pub
    cmd: ssh-keygen -t ed25519 -f /home/peers/self/.ssh/id_ed25519 -N ""

- name: common-peering-local-confkey
  copy:
    src: ../files/ssh_config
    dest: /home/peers/self/.ssh/config
