infrastructure/ansible/roles/traefik/tasks/main.yml
2020-12-22 15:53:03 +00:00

49 lines
1.2 KiB
YAML

- name: Create install directory
file:
path: /opt/traefik
state: directory
owner: "{{ docker_user.name }}"
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Create config directory
file:
path: /opt/traefik/traefik/
state: directory
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Create file provider directory
file:
path: /opt/traefik/traefik/conf
state: directory
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Install compose file
template:
src: files/docker-compose.yml
dest: /opt/traefik/docker-compose.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
validate: /usr/bin/docker-compose -f %s config
notify: restart traefik
become: true
- name: Install config
template:
src: files/traefik.yml
dest: /opt/traefik/traefik/traefik.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
notify: restart traefik
become: true
- name: Install file provider
template:
src: files/file-provider-main.yml
dest: /opt/traefik/traefik/conf/main.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
notify: restart traefik
become: true