Add wireguard
This commit is contained in:
parent
2a36002124
commit
a259572a20
7 changed files with 83 additions and 0 deletions
22
roles/wireguard/tasks/base.yml
Normal file
22
roles/wireguard/tasks/base.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
|
||||
- name: Check wireguard directory exist
|
||||
ansible.builtin.file:
|
||||
path: wireguard
|
||||
state: directory
|
||||
|
||||
- name: Copy template conf
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "wireguard/{{ item.dest }}"
|
||||
loop:
|
||||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||
register: wireguard_copy_templates_results
|
||||
|
||||
- name: Update and restart container
|
||||
community.docker.docker_compose:
|
||||
project_src: wireguard
|
||||
state: present
|
||||
pull: true
|
||||
restarted: "{{ wireguard_copy_templates_results.changed }}"
|
||||
become: true
|
Loading…
Add table
Add a link
Reference in a new issue