This repository was archived by the owner on Mar 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults
23
23
24
24
| Name | Default Value | Description |
25
25
| -------------- | ------------- | -----------------------------------|
26
- | ` prometheus_version ` | 2.2.1 | Prometheus package version |
26
+ | ` prometheus_version ` | 2.2.1 | Prometheus package version. Also accepts ` latest ` as parameter. |
27
27
| ` prometheus_config_dir ` | /etc/prometheus | Path to directory with prometheus configuration |
28
28
| ` prometheus_db_dir ` | /var/lib/prometheus | Path to directory with prometheus database |
29
29
| ` prometheus_web_listen_address ` | "0.0.0.0:9090" | Address on which prometheus will be listening |
Original file line number Diff line number Diff line change 50
50
when : not prometheus_config_dir + "/file_sd/" + item.key + ".yml" in file_sd_files
51
51
# when: not item | basename | splitext | difference(['.yml']) | join('') in prometheus_targets.keys()
52
52
with_dict : " {{ prometheus_targets }}"
53
+
54
+ - block :
55
+ - name : get latest release
56
+ uri :
57
+ url : " https://api.github.com/repos/prometheus/prometheus/releases/latest"
58
+ method : GET
59
+ return_content : yes
60
+ status_code : 200
61
+ body_format : json
62
+ validate_certs : no
63
+ register : _latest_release
64
+ until : result.status == 200
65
+ retries : 5
66
+
67
+ - name : " Set prometheus version to {{ _latest_release.json.tag_name[1:] }}"
68
+ set_fact :
69
+ prometheus_version : " {{ _latest_release.json.tag_name[1:] }}"
70
+ when : prometheus_version == "latest"
You can’t perform that action at this time.
0 commit comments