From f04f3acc58831a383a73266839051514802d8b79 Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Mon, 2 Dec 2019 14:24:57 -0500 Subject: [PATCH] Changed to label based config Removed traefik.yml in favor of label based configuration and changed hosts to moxietest --- moxie.yml | 2 +- roles/traefik/tasks/main.yml | 8 +------- roles/traefik/traefik.yml | 8 -------- roles/wordpress/tasks/main.yml | 2 ++ 4 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 roles/traefik/traefik.yml diff --git a/moxie.yml b/moxie.yml index c90ec0a..7e19c3f 100644 --- a/moxie.yml +++ b/moxie.yml @@ -13,7 +13,7 @@ # along with this program. If not, see . - name: Install Moxie Server - hosts: all + hosts: moxietest become: true # Install host requirements for playbooks diff --git a/roles/traefik/tasks/main.yml b/roles/traefik/tasks/main.yml index fcacad8..c4a35be 100644 --- a/roles/traefik/tasks/main.yml +++ b/roles/traefik/tasks/main.yml @@ -1,18 +1,12 @@ -- name: Install Traefik Configuration - template: - src: traefik.yml - dest: traefik.yml - notify: Restart Traefik container - - name: Start Traefik container docker_container: name: "{{ traefik_name }}" image: traefik:{{ traefik_version }} + command: --api.insecure=true --providers.docker state: started restart_policy: always ports: - "{{ traefik_port }}:80" - "{{ traefik_admin_port }}:8080" volumes: - - ./traefik.yml:/etc/traefik/traefik.yml - /var/run/docker.sock:/var/run/docker.sock diff --git a/roles/traefik/traefik.yml b/roles/traefik/traefik.yml deleted file mode 100644 index e312578..0000000 --- a/roles/traefik/traefik.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Docker configuration backend -providers: - docker: - defaultRule: "Host(`{{'{{'}} trimPrefix `/` .Name }}.{{ traefik_domain }}`)" - -# API and dashboard configuration -api: - insecure: true diff --git a/roles/wordpress/tasks/main.yml b/roles/wordpress/tasks/main.yml index 87ebd16..f07d74d 100644 --- a/roles/wordpress/tasks/main.yml +++ b/roles/wordpress/tasks/main.yml @@ -16,6 +16,8 @@ image: wordpress:{{ wordpress_version }} restart_policy: always volumes: wordpress:/var/www/html + labels: + traefik.http.routers.wordpress.rule: "Host(`{{ wordpress_domain }}`)" links: - "{{ mariadb_name }}" env: