27 lines
935 B
YAML
27 lines
935 B
YAML
---
|
|
- name: Set common facts
|
|
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
|
|
|
- name: Deploy {{ role_name }}
|
|
vars:
|
|
svc: "{{ telegraf_svc }}"
|
|
env: "{{ telegraf_env }}"
|
|
compose: "{{ telegraf_compose }}"
|
|
block:
|
|
- name: Import prepare tasks for common service
|
|
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
|
|
|
- name: Template config
|
|
ansible.builtin.template:
|
|
src: telegraf.conf.j2
|
|
dest: "{{ (service_path, 'telegraf.conf') | path_join }}"
|
|
mode: "0664"
|
|
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
|