This repository has been archived on 2023-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
max/roles/traefik/tasks/main.yml

34 lines
922 B
YAML
Raw Permalink Normal View History

2023-01-02 16:39:17 +00:00
- name: Create traefik app directory
file:
2023-01-07 19:32:42 +00:00
path: "{{ service_dir }}"
2023-01-02 16:39:17 +00:00
state: directory
- name: Create acme file
copy:
content: ""
2023-01-07 19:32:42 +00:00
dest: "{{ service_dir }}/acme.json"
2023-01-02 16:39:17 +00:00
force: no
2023-01-02 22:16:29 +00:00
mode: 0600
2023-01-02 16:39:17 +00:00
- name: Copy Docker Compose script
2023-01-07 19:32:42 +00:00
template:
src: "{{ role_path }}/templates/docker-compose.yml.j2"
dest: "{{ service_dir }}/docker-compose.yml"
2023-01-02 16:39:17 +00:00
- name: Copy traefik.toml
2023-01-14 17:00:01 +00:00
template:
src: "{{ role_path }}/templates/traefik.toml.j2"
2023-01-07 19:32:42 +00:00
dest: "{{ service_dir }}/traefik.toml"
register: traefik
2023-01-02 16:39:17 +00:00
- name: Copy services.toml
copy:
src: "{{ role_path }}/files/services.toml"
2023-01-07 19:32:42 +00:00
dest: "{{ service_dir }}/services.toml"
register: services
2023-01-02 22:16:29 +00:00
- name: Create traefik network
docker_network:
name: "traefik"
2023-01-02 16:39:17 +00:00
- name: Start Docker Compose
docker_compose:
2023-01-07 19:32:42 +00:00
project_src: "{{ service_dir }}"
2023-01-02 16:39:17 +00:00
pull: true
remove_orphans: true
restarted: "{{ traefik.changed or services.changed }}"