37 lines
1.2 KiB
YAML
37 lines
1.2 KiB
YAML
---
|
|
- name: Set common facts
|
|
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
|
|
|
- name: Deploy {{ svc.name }}
|
|
vars:
|
|
svc: "{{ acme_dns_svc }}"
|
|
env: "{{ acme_dns_env }}"
|
|
compose: "{{ acme_dns_compose }}"
|
|
block:
|
|
- name: Import prepare tasks for common service
|
|
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
|
|
|
- name: Setting the service config path
|
|
ansible.builtin.set_fact:
|
|
config_path: "{{ (service_path, 'config') | path_join }}"
|
|
|
|
- name: Create a service-config directory
|
|
ansible.builtin.file:
|
|
path: "{{ config_path }}"
|
|
state: directory
|
|
mode: "0700"
|
|
|
|
- name: Template config
|
|
ansible.builtin.template:
|
|
src: config.cfg.j2
|
|
dest: "{{ (config_path, 'config.cfg') | path_join }}"
|
|
mode: "0600"
|
|
register: cmd_result
|
|
|
|
- name: Set the docker force-recreate flag
|
|
ansible.builtin.set_fact:
|
|
docker_force_recreate: --force-recreate
|
|
when: cmd_result.changed # noqa: no-handler We need to handle the restart per service. Handlers don't support variables.
|
|
|
|
- name: Import start tasks for common service
|
|
ansible.builtin.import_tasks: tasks/start-common-service.yml
|