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

35 lines
866 B
YAML
Raw Normal View History

---
- name: Check cloud directory exist
ansible.builtin.file:
path: cloud
state: directory
- name: Copy cloud conf
ansible.builtin.copy:
src: .
dest: cloud/
register: cloud_copy_files_results
2023-05-21 15:19:59 +02:00
- name: Ensure cron.sh as +x permission
ansible.builtin.file:
path: cloud/cron.sh
mode: u=rwx,g=rx,o=rx
modification_time: preserve
access_time: preserve
- name: Copy template conf
ansible.builtin.template:
src: "{{ item.src }}"
dest: "cloud/{{ item.dest }}"
loop:
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
register: cloud_copy_templates_results
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: cloud
state: present
2024-07-14 21:39:23 +02:00
pull: always
2023-05-21 10:57:56 +02:00
restarted: "{{ cloud_copy_files_results.changed or cloud_copy_templates_results.changed }}"
become: true