Changed to label based config

Removed traefik.yml in favor of label based configuration and
changed hosts to moxietest
This commit is contained in:
Kris Lamoureux 2019-12-02 14:24:57 -05:00
parent 8787722c6c
commit f04f3acc58
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
4 changed files with 4 additions and 16 deletions

View File

@ -13,7 +13,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
- name: Install Moxie Server
hosts: all
hosts: moxietest
become: true
# Install host requirements for playbooks

View File

@ -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

View File

@ -1,8 +0,0 @@
# Docker configuration backend
providers:
docker:
defaultRule: "Host(`{{'{{'}} trimPrefix `/` .Name }}.{{ traefik_domain }}`)"
# API and dashboard configuration
api:
insecure: true

View File

@ -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: