ansible-role-docker_traefik/tasks/main.yml

47 lines
1.3 KiB
YAML

- name: Traefik network
community.docker.docker_network:
name: traefik
- name: Traefik dir
ansible.builtin.file:
path: "{{ docker_traefik_install_dir }}"
state: directory
mode: u=rwx,g=rx,o=
- name: Traefik compose
ansible.builtin.template:
src: traefik-docker-compose.yml.j2
dest: "{{ docker_traefik_install_dir }}/docker-compose.yml"
mode: u=rw,g=r,o=r
notify: Docker-compose-up
- name: Prepare certs-traefik.yaml
ansible.builtin.template:
src: certs-traefik.yaml
dest: "{{ docker_traefik_install_dir }}/certs-traefik.yaml"
mode: u=rw,g=r,o=r
notify: Docker-compose-up
- name: Copie le certificat pour tls
ansible.builtin.get_url:
url: "{{ docker_traefik_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_traefik_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