---
- name: Configure local environment
  delegate_to: 127.0.0.1
  block:
    - name: Create local_ssh directory
      file:
        path: ~/.ssh
        state: directory
        mode: 0700

    - name: Add ansible user SSH key
      template:
        src: ../templates/ansible_key.j2
        dest: ~/.ssh/ansible_key
        mode: 0600

    - name: Add ansible user public key
      template:
        src: ../templates/ansible_key.pub.j2
        dest: ~/.ssh/ansible_key.pub
        mode: 0644
