feat: initial commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-01-15 21:32:00 +01:00
commit e53a7da36c
40 changed files with 516 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
---
- name: configure | deploy systemd configuration
template:
src: etc/systemd/system/traefik.service.j2
dest: /etc/systemd/system/traefik.service
owner: root
group: root
mode: 0644
notify: "restart traefik"
- name: configure | deploy traefik configuration
template:
src: opt/traefik/traefik.toml.j2
dest: "{{ traefik_docker_compose_directory }}/traefik.toml"
owner: root
group: root
mode: 0644
notify: "restart traefik"
- name: configure | create acme.json
file:
path: "{{ traefik_docker_compose_directory }}/acme.json"
owner: root
group: root
state: touch
mode: 0600
changed_when: no
- name: configure | create network traefik_network
command: docker network create traefik_network
ignore_errors: yes
changed_when: no
- name: configure | flush handlers
meta: flush_handlers

View File

@@ -0,0 +1,12 @@
---
- name: install | create directory {{ traefik_docker_compose_directory }}
file:
path: "{{ traefik_docker_compose_directory }}"
state: directory
mode: 0755
- name: install | set compose file
template:
src: opt/traefik/docker-compose.yml.j2
dest: "{{ traefik_docker_compose_directory }}/docker-compose.yml"
notify: 'restart traefik'

View File

@@ -0,0 +1,2 @@
---
- include_tasks: "{{ traefik_state }}.yml"

View File

@@ -0,0 +1,4 @@
---
- include_tasks: "install.yml"
- include_tasks: "configure.yml"
- include_tasks: "start.yml"

View File

@@ -0,0 +1,10 @@
---
- name: start | ensure traefik is up and running
service:
name: traefik
state: started
- name: start | wait for traefik up and running
wait_for:
port: 443
delay: 10

View File

@@ -0,0 +1,5 @@
---
- name: stop | ensure traefik is up and running
service:
name: traefik
state: stopped