23 lines
563 B
YAML
23 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
|