39 lines
719 B
YAML
39 lines
719 B
YAML
|
- 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
|