File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11terrarium_traefik_config_dir : /etc/traefik
2+ terrarium_traefik_version : v3.6.7
Original file line number Diff line number Diff line change 1+ - name : reload traefik systemd
2+ ansible.builtin.systemd :
3+ daemon_reload : true
4+
15- name : restart traefik
26 ansible.builtin.systemd :
37 name : traefik
Original file line number Diff line number Diff line change 1- - name : Install Traefik
2- ansible.builtin.apt :
3- name : traefik
4- state : present
1+ - name : Map Traefik release architecture
2+ ansible.builtin.set_fact :
3+ terrarium_traefik_arch : >-
4+ {{
5+ {
6+ 'x86_64': 'amd64',
7+ 'aarch64': 'arm64'
8+ }[ansible_architecture]
9+ }}
10+
11+ - name : Download Traefik release archive
12+ ansible.builtin.get_url :
13+ url : " https://github.com/traefik/traefik/releases/download/{{ terrarium_traefik_version }}/traefik_{{ terrarium_traefik_version }}_linux_{{ terrarium_traefik_arch }}.tar.gz"
14+ dest : " /tmp/traefik_{{ terrarium_traefik_version }}_linux_{{ terrarium_traefik_arch }}.tar.gz"
15+ mode : " 0644"
16+
17+ - name : Extract Traefik binary
18+ ansible.builtin.unarchive :
19+ src : " /tmp/traefik_{{ terrarium_traefik_version }}_linux_{{ terrarium_traefik_arch }}.tar.gz"
20+ dest : /tmp
21+ remote_src : true
22+
23+ - name : Install Traefik binary
24+ ansible.builtin.copy :
25+ src : /tmp/traefik
26+ dest : /usr/local/bin/traefik
27+ mode : " 0755"
28+ remote_src : true
29+
30+ - name : Install Traefik systemd service
31+ ansible.builtin.template :
32+ src : traefik.service.j2
33+ dest : /etc/systemd/system/traefik.service
34+ mode : " 0644"
35+ notify : reload traefik systemd
536
637- name : Create Traefik directories
738 ansible.builtin.file :
6899 name : traefik
69100 state : started
70101 enabled : true
102+ daemon_reload : true
71103
72104- name : Run Traefik sync immediately
73105 ansible.builtin.command : /usr/local/bin/terrariumctl proxy sync
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description=Traefik reverse proxy
3+ After=network-online.target
4+ Wants=network-online.target
5+
6+ [Service]
7+ Type=simple
8+ ExecStart=/usr/local/bin/traefik --configFile={{ terrarium_traefik_config_dir }}/traefik.yml
9+ Restart=on-failure
10+ RestartSec=5s
11+
12+ [Install]
13+ WantedBy=multi-user.target
You can’t perform that action at this time.
0 commit comments