1
0
Fork 0
myserver-configuration/roles/wireguard/tasks/base.yml
2023-09-24 12:28:25 +02:00

22 lines
563 B
YAML

---
- 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