Skip to content

Commit

Permalink
Update traefik, install by version number, check checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
danivovich committed Jan 26, 2018
1 parent cf11a1c commit f0a14f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Basic traefik configuration
```
- src: [email protected]:smartlogic/ansible-role-traefik
name: traefik
version: 0.1.0
version: 0.2.0
```

## Requirements
Expand All @@ -17,6 +17,7 @@ None
## Role Variables

- `traefik_version` - Which version of traefik to download
- `traefik_checksum` - The sha256 checksum of the traefik download
- `traefik_config` - The file to use for `config.toml`
- Default: `config.toml`

Expand Down
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
traefik_version: 1.4.1
traefik_version: 1.5.0
traefik_checksum: f5bad64d95377a890f7e04640f6356df41c7c196b317a0f8f76a952979dbea50
traefik_config: "config.toml"
10 changes: 9 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@
mode: 0755
become: yes

- name: "Create traefik version folder"
file:
path: "/opt/traefik/{{ traefik_version }}"
state: directory
mode: 0755
become: yes

- name: "Download traefik"
get_url:
url: "https://github.com/containous/traefik/releases/download/v{{ traefik_version }}/traefik_linux-amd64"
dest: "/opt/traefik/traefik"
dest: "/opt/traefik/{{ traefik_version }}/traefik"
mode: 0755
checksum: "sha256:{{ traefik_checksum }}"
become: yes

- name: Copy config.yml
Expand Down
2 changes: 1 addition & 1 deletion templates/traefik.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ After=network-online.target
[Service]
Restart=on-failure
WorkingDirectory=/opt/traefik
ExecStart=/opt/traefik/traefik --configfile=/opt/traefik/config.toml
ExecStart=/opt/traefik/{{ traefik_version }}/traefik --configfile=/opt/traefik/config.toml

[Install]
WantedBy=multi-user.target

0 comments on commit f0a14f8

Please sign in to comment.