43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
- name: Docker directory
|
|
ansible.builtin.file:
|
|
path: /opt/{{ docker_nodeexporter_service_id }}/
|
|
state: directory
|
|
|
|
- name: Prepare docker-compose.yml
|
|
ansible.builtin.template:
|
|
src: docker-compose.yml
|
|
dest: /opt/{{ docker_nodeexporter_service_id }}/
|
|
notify: docker-compose-up
|
|
|
|
- name: Prepare config.yml
|
|
ansible.builtin.template:
|
|
src: config.yml
|
|
dest: /opt/{{ docker_nodeexporter_service_id }}/
|
|
when: docker_nodeexporter_enable_tlsauth
|
|
notify: docker-compose-up
|
|
|
|
- name: Copie le certificat pour tls
|
|
ansible.builtin.get_url:
|
|
url: "{{ docker_nodeexporter_certificate_url }}"
|
|
dest: /opt/{{ docker_nodeexporter_service_id }}/cert.pem
|
|
username: "{{ lookup('env', 'AAP_RESSOURCES_USER') }}"
|
|
password: "{{ lookup('env', 'AAP_RESSOURCES_PASSWORD') }}"
|
|
mode: u=rw,g=r,o=r
|
|
owner: root
|
|
group: root
|
|
notify:
|
|
- docker-compose-up
|
|
when: docker_nodeexporter_enable_tlsauth
|
|
|
|
- name: Copie la clé pour tls
|
|
ansible.builtin.get_url:
|
|
url: "{{ docker_nodeexporter_key_url }}"
|
|
dest: /opt/{{ docker_nodeexporter_service_id }}/key.pem
|
|
username: "{{ lookup('env', 'AAP_RESSOURCES_USER') }}"
|
|
password: "{{ lookup('env', 'AAP_RESSOURCES_PASSWORD') }}"
|
|
mode: u=rw,g=r,o=r
|
|
owner: root
|
|
group: root
|
|
notify:
|
|
- docker-compose-up
|
|
when: docker_nodeexporter_enable_tlsauth
|