38 lines
1.6 KiB
YAML
38 lines
1.6 KiB
YAML
- name: Wireguard
|
|
hosts: pi
|
|
become: true
|
|
vars:
|
|
wireguard_private_key: !vault |
|
|
$ANSIBLE_VAULT;1.1;AES256
|
|
64663235376666616263333732653733633362393634663130356638353431633635373437323961
|
|
3030636636626339316366326161623236303937623338380a656639636338643937323037366139
|
|
64633263646664303962323830663435343531393231393939663633343165383163626466633231
|
|
3138326563386233390a386237633630656436663062633264366562616632633035343733323331
|
|
64366538386364623938663836336661313632376131336338643432646338303738616438623361
|
|
6237653737666662336665326237623331383132653431343466
|
|
wireguard_server_private_key: !vault |
|
|
$ANSIBLE_VAULT;1.1;AES256
|
|
38633732343939346261653834393536313335376166616661373266616266353938633363373464
|
|
3233646466303834656633656237643632666462323264360a333066313361323038366265316330
|
|
32626534313239353833653638353364313136333932386331373132356333663935366466653435
|
|
3636323037366333350a313761643565633165643938303330386431623237356262323332306533
|
|
34623734623661333266393930306439336533343566306635633638326334303364353036383036
|
|
3461343263306434386135356638623636393030646236346531
|
|
tasks:
|
|
- name: Install wireguard
|
|
ansible.builtin.apt:
|
|
name: wireguard
|
|
state: present
|
|
|
|
- name: Copy wg0.conf
|
|
ansible.builtin.template:
|
|
src: wg0.conf.j2
|
|
dest: /etc/wireguard/wg0.conf
|
|
mode: '0600'
|
|
|
|
- name: Start service
|
|
ansible.builtin.service:
|
|
name: wg-quick@wg0
|
|
state: restarted
|
|
enabled: true
|