1
0
Fork 0
myserver-configuration/roles/protonmail/tasks/base.yml

40 lines
1.1 KiB
YAML
Raw Normal View History

---
- name: Check protonmail directory exist
ansible.builtin.file:
path: protonmail
state: directory
- name: Copy protonmail conf
ansible.builtin.copy:
src: .
dest: protonmail/
register: protonmail_copy_files_results
- name: Copy template conf
ansible.builtin.template:
src: "{{ item.src }}"
dest: "protonmail/{{ item.dest }}"
loop:
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
register: protonmail_copy_templates_results
- name: Create protonmail network
community.docker.docker_network:
name: protonmail
state: present
become: true
- name: Show message if not initialized
ansible.builtin.debug:
msg: Please run init.sh in protonmail folder and set variable protonmail.initialized to true and restart tasks
when: not protonmail.initialized
2023-05-21 10:57:56 +02:00
- name: Update and restart container
2024-07-14 21:39:23 +02:00
community.docker.docker_compose_v2:
project_src: protonmail
state: present
2024-07-14 21:39:23 +02:00
pull: always
2023-05-21 10:57:56 +02:00
restarted: "{{ protonmail.initialized and (protonmail_copy_templates_results.changed or protonmail_copy_files_results.changed) }}"
become: true