Initial commit
This commit is contained in:
39
tasks/deploy.yaml
Normal file
39
tasks/deploy.yaml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: "{{ app_name }} - Deploy Docker Compose configuration"
|
||||
block:
|
||||
- name: Copy Docker Compose template
|
||||
ansible.builtin.template:
|
||||
src: "{{ app_compose_template }}"
|
||||
dest: "{{ app_compose_dest }}"
|
||||
mode: "{{ app_permission_mode }}"
|
||||
owner: "{{ app_uid }}"
|
||||
group: "{{ app_gid }}"
|
||||
validate: "{{ 'docker compose -f %s config -q' if app_compose_validate else omit }}"
|
||||
when: _compose_type == 'template'
|
||||
register: compose_file
|
||||
|
||||
- name: Copy Docker Compose file
|
||||
ansible.builtin.copy:
|
||||
src: "{{ app_compose_file }}"
|
||||
dest: "{{ app_compose_dest }}"
|
||||
mode: "{{ app_permission_mode }}"
|
||||
owner: "{{ app_uid }}"
|
||||
group: "{{ app_gid }}"
|
||||
validate: "{{ 'docker compose -f %s config -q' if app_compose_validate else omit }}"
|
||||
when: _compose_type == 'file'
|
||||
register: compose_file
|
||||
|
||||
- name: Copy Docker Compose content from YAML string
|
||||
ansible.builtin.copy:
|
||||
content: "{{ app_compose_content }}"
|
||||
dest: "{{ app_compose_dest }}"
|
||||
mode: "{{ app_permission_mode }}"
|
||||
owner: "{{ app_uid }}"
|
||||
group: "{{ app_gid }}"
|
||||
validate: "{{ 'docker compose -f %s config -q' if app_compose_validate else omit }}"
|
||||
when: _compose_type == 'content'
|
||||
register: compose_file
|
||||
|
||||
- ansible.builtin.include_tasks: manage_compose.yaml
|
||||
when: app_compose_start | default(true)
|
||||
tags: [deploy]
|
||||
Reference in New Issue
Block a user