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 +23
-16
lines changed Expand file tree Collapse file tree 2 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ Deploy [Prometheus](https://github.com/prometheus/prometheus) monitoring system
16
16
17
17
- Ansible >= 2.3
18
18
- jmespath on deployer machine. If you are using Ansible from a Python virtualenv, install * jmespath* to the same virtualenv via pip.
19
+ - gnu-tar on Mac deployer host (` brew install gnu-tar ` )
19
20
20
21
## Role Variables
21
22
Original file line number Diff line number Diff line change 36
36
37
37
- name : download prometheus binary to local folder
38
38
become : no
39
- unarchive :
40
- src : " https://github.com/prometheus/prometheus/releases/download/v{{ prometheus_version }}/prometheus-{{ prometheus_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz"
39
+ get_url :
40
+ url : " https://github.com/prometheus/prometheus/releases/download/v{{ prometheus_version }}/prometheus-{{ prometheus_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz"
41
41
dest : " /tmp"
42
- remote_src : yes
43
- creates : " /tmp/prometheus-{{ prometheus_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}/prometheus"
44
- register : _download_binary
45
- until : _download_binary is succeeded
42
+ register : _download_archive
43
+ until : _download_archive is succeeded
46
44
retries : 5
47
45
delay : 2
48
- # run_once: true
46
+ # run_once: true # <-- this cannot be set due to multi-arch support
49
47
delegate_to : localhost
50
- check_mode : no
51
48
52
- - name : remove prometheus binaries from old location
53
- file :
54
- path : " {{ item }} "
55
- state : absent
56
- with_items :
57
- - /opt /prometheus/prometheus
58
- - /opt/prometheus/promtool
59
- - /opt/prometheus
49
+ - name : unpack prometheus binaries
50
+ become : no
51
+ unarchive :
52
+ src : " /tmp/prometheus-{{ prometheus_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz "
53
+ dest : " /tmp "
54
+ creates : " /tmp /prometheus-{{ prometheus_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }} /prometheus"
55
+ delegate_to : localhost
56
+ check_mode : no
60
57
61
58
- name : propagate prometheus and promtool binaries
62
59
copy :
72
69
notify :
73
70
- restart prometheus
74
71
72
+ - name : remove prometheus binaries from old location
73
+ file :
74
+ path : " {{ item }}"
75
+ state : absent
76
+ with_items :
77
+ - /opt/prometheus/prometheus
78
+ - /opt/prometheus/promtool
79
+ - /opt/prometheus
80
+
75
81
- name : create systemd service unit
76
82
template :
77
83
src : prometheus.service.j2
You can’t perform that action at this time.
0 commit comments