32 lines
1.1 KiB
YAML
32 lines
1.1 KiB
YAML
- name: Wireguard-ingress
|
|
hosts: animeistrash
|
|
become: true
|
|
vars:
|
|
wireguard_server_private_key: !vault |
|
|
$ANSIBLE_VAULT;1.1;AES256
|
|
34313837363964633333373936636462666138386538653939663435376666626230393564366630
|
|
6637333264303638383938326132336130343833393466370a623633623163303762616333663135
|
|
61666433393939303938623735666439663361633638613466393361626439326465303966303266
|
|
3239666637326337650a636433616264386162326535306461326233323961643664373134363634
|
|
35633238393933386231373535353635646462383763613362363761363935363965383836366431
|
|
3766343166643632306162343761613030653631353361373936
|
|
tasks:
|
|
- name: Install wireguard
|
|
ansible.builtin.apt:
|
|
name: wireguard
|
|
state: present
|
|
|
|
- name: Down wg0
|
|
changed_when: true
|
|
ansible.builtin.command: wg-quick down wg0
|
|
|
|
- name: Copy wg0.conf
|
|
ansible.builtin.template:
|
|
src: wg0.conf.j2
|
|
dest: /etc/wireguard/wg0.conf
|
|
mode: '0600'
|
|
|
|
- name: Up wg0
|
|
changed_when: true
|
|
ansible.builtin.command: wg-quick up wg0
|