ansible-role-traefik/tasks/main.yml

39 lines
719 B
YAML
Raw Normal View History

2020-11-27 12:39:51 +01:00
- name: install
package:
name: traefik
state: latest
- name: fix owner of acme file
file:
path: "/etc/traefik/acme.json"
owner: traefik
mode: '0600'
- name: configure
notify: restart traefik
template:
src: config.toml
dest: "/etc/traefik/traefik.toml"
owner: traefik
- name: create config directory
file:
path: /etc/traefik/conf.d
state: directory
owner: traefik
- name: template config files
template:
src: "{{ item }}"
dest: "/etc/traefik/conf.d/{{ item | basename }}"
owner: traefik
with_fileglob:
- ../templates/conf.d/*
- name: service enabled and started
become: yes
systemd:
name: traefik
state: started
enabled: yes