inst-wireguard.yaml 395 B

12345678910111213141516
  1. ---
  2. - name: Install wireguard
  3. hosts: "{{ my_hosts | d([]) }}"
  4. become: true
  5. tasks:
  6. - name: Install wireguard
  7. ansible.builtin.apt:
  8. name: wireguard
  9. update_cache: true
  10. - name: Generate private and public keypair
  11. ansible.builtin.shell: |
  12. wg genkey | tee privatekey | wg pubkey > publickey
  13. chmod 0400 privatekey
  14. chmod 0400 publickey