Move traefik into its own role

This commit is contained in:
Jake Howard 2020-04-23 20:49:43 +01:00
parent 9962d9103f
commit 89ba23719c
Signed by: jake
GPG key ID: 57AFB45680EDD477
9 changed files with 14 additions and 23 deletions

View file

@ -1,2 +1,6 @@
docker_user:
id: 3000
name: dockeruser
docker_compose_file_mask: 0664
docker_compose_directory_mask: 0775

View file

@ -21,4 +21,5 @@
docker_users:
- "{{ user }}"
- docker-cleanup
- traefik
- docker

View file

@ -1,6 +1,3 @@
- name: Include docker variables
include_vars: docker.yml
- name: Install docker-compose
apt:
name: docker-compose

View file

@ -1,3 +0,0 @@
docker_user:
id: 3000
name: dockeruser

View file

@ -1,8 +1,3 @@
- name: Include docker variables
include_vars: docker.yml
# Applications
- name: Install calibre
include: calibre.yml
@ -51,9 +46,6 @@
- name: Install theorangeone.net
include: theorangeone.net.yml
- name: Install traefik
include: traefik.yml
- name: Install tt-rss
include: tt-rss.yml

View file

@ -1,4 +1,4 @@
- name: Create traefik directory
- name: Create install directory
file:
path: /opt/traefik
state: directory
@ -6,16 +6,16 @@
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Create traefik config directory
- name: Create config directory
file:
path: /opt/traefik/traefik
state: directory
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Install traefik compose file
- name: Install compose file
template:
src: files/traefik/docker-compose.yml
src: files/docker-compose.yml
dest: /opt/traefik/docker-compose.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
@ -23,25 +23,25 @@
register: compose_file
become: true
- name: Install traefik config
- name: Install config
template:
src: files/traefik/traefik.yml
src: files/traefik.yml
dest: /opt/traefik/traefik/traefik.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
register: config_file
become: true
- name: Install traefik file provider
- name: Install file provider
template:
src: files/traefik/file-provider.yml
src: files/file-provider.yml
dest: /opt/traefik/traefik/file-provider.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
register: file_provider
become: true
- name: Cycle traefik container
- name: Cycle container
docker_compose:
project_src: /opt/traefik
pull: true