---
- name: Tinc key generation
  command: "{{ tincd }} -c '{{ _destdir }}' -o name={{ tinc_hostname }} --generate-keys=4096"
  args:
    creates: "{{ _destdir }}/{{ tinc_hostname }}.priv"
  delegate_to: localhost

- name: Tinc rename private key
  command: "mv '{{ _destdir }}/rsa_key.priv' '{{ _destdir }}/{{ tinc_hostname }}.priv'"
  args:
    removes: "{{ _destdir }}/rsa_key.priv"
    creates: "{{ _destdir }}/{{ tinc_hostname }}.priv"
  delegate_to: localhost
