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

33 lines
854 B
YAML
Raw Normal View History

2023-06-11 00:44:23 +02:00
---
- name: Check dolibarr directory exist
ansible.builtin.file:
path: dolibarr
state: directory
register: first_install
- name: Copy template conf
ansible.builtin.template:
src: "{{ item.src }}"
dest: "dolibarr/{{ item.dest }}"
loop:
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
register: dolibarr_copy_templates_results
- name: Prepare volume folder
ansible.builtin.file:
path: "{{ item }}"
state: directory
loop:
- "{{ server.work_dir }}/dolibarr/base/documents"
- "{{ server.work_dir }}/dolibarr/base/html"
- "{{ server.work_dir }}/dolibarr/db"
become: true
- name: Update and restart container
2024-07-14 21:39:23 +02:00
community.docker.docker_compose_v2:
2023-06-11 00:44:23 +02:00
project_src: dolibarr
state: present
2024-07-14 21:39:23 +02:00
pull: always
2023-06-11 00:44:23 +02:00
restarted: "{{ dolibarr_copy_templates_results.changed }}"
become: true