ansible-role-docker_nodeexp.../tasks/main.yml

38 lines
1 KiB
YAML
Raw Normal View History

2022-06-12 23:07:59 +02:00
- name: docker directory
file:
path: /opt/{{ docker_nodeexporter_service_id }}/
state: directory
- name: prepare config
2022-06-12 23:07:59 +02:00
template:
src: "{{ item }}"
dest: /opt/{{ docker_nodeexporter_service_id }}/
with_items:
- docker-compose.yml
- config.yml
2022-06-12 23:07:59 +02:00
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
- 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=
owner: root
group: root
notify:
- docker-compose-up