mirror of
https://github.com/Crocmagnon/ansible.git
synced 2024-12-04 21:13:38 +01:00
33 lines
900 B
YAML
33 lines
900 B
YAML
---
|
|
- name: Create dir
|
|
ansible.builtin.file:
|
|
path: "{{ docker_dir }}"
|
|
state: directory
|
|
mode: "0775"
|
|
- name: Write files
|
|
ansible.builtin.copy:
|
|
src: "{{ item }}"
|
|
dest: "{{ docker_dir }}/"
|
|
mode: preserve
|
|
with_fileglob:
|
|
- files/{{ docker_app_name }}/*
|
|
- files/{{ docker_app_name }}/.*
|
|
notify:
|
|
- Restart service
|
|
- name: Write templates
|
|
ansible.builtin.template:
|
|
src: "{{ item }}"
|
|
dest: "{{ docker_dir }}/{{ item | basename | regex_replace('\\.j2$', '') }}"
|
|
mode: preserve
|
|
with_fileglob:
|
|
- templates/{{ docker_app_name }}/*.j2
|
|
- templates/{{ docker_app_name }}/.*.j2
|
|
notify:
|
|
- Restart service
|
|
- name: Flush handlers
|
|
ansible.builtin.meta: flush_handlers
|
|
- name: Ensure service is started
|
|
community.docker.docker_compose_v2:
|
|
project_src: "{{ docker_dir }}"
|
|
state: present
|
|
remove_orphans: "{{ docker_remove_orphans }}"
|