Skip to content

Commit

Permalink
added ability to use latest
Browse files Browse the repository at this point in the history
  • Loading branch information
adworjan committed Nov 9, 2023
1 parent 410a889 commit f79db05
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .ansible-sign/sha256sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ ca3f84e14f6aa778003094fd160710543fae3594d76dbc4335d2d0b77245e8ce AnsibleSSP.cod
e81d36021af399b6ecafeecde71a8634aacbf718a56ecc5878dec71180d8b704 ELKBuild.yml
c8066ae4c79ca812f0abde5b42d4a0bf954a60c88b3eab2149d75d98b567c931 Elastic_restart.yml
936cb966490bb452f91f2cb5b0821ef31c4bc8e62cf2c57a2c11640b60db7e18 MANIFEST.in
e23aacc90b0cced31153f1d5f62e018d3ee59fe03d1b7265cfdb9a10c242e875 Nodeexporter.yml
86472c01b5463af6861466a9f297665d4cbfd9d0941ec3cb2e4a818ecb873969 Promgraf.yml
e0567f633595756e3e406e38295b4b4148929ee67caa748347f56fe47d28fc73 Nodeexporter.yml
cc4ccf59e396b93c14bc40acab5da37699f8c6b587fb476f2377f5ea71f2a5e1 Promgraf.yml
798346886b7ec801a19ed365c33f092e2d5dfb564c034ae886bc51785c89b232 README.md
88223aecf0ee1bfa38a215a481e1dd48054d043a7b52b9fd81243f9699d6142c collections/requirements.yml
bcc7a97fdb676c3f94875a674a87d25cd286cabba5820a5bb0a3eb228951b568 email.yml
Expand All @@ -25,7 +25,7 @@ fde421bd02e9d5d96effcbef92b4657f2ed9283855cebafcb3246c4829882382 roles/kafka/ha
b6feda249d68b441cf3dedb363eee0aa78543b6566b276542ec93da0830c5890 roles/kafka/tasks/main.yml
7f721521e6af1761575abf516441d5d4752ca2d0d5908ee2cfbdb0aaa64a53ef roles/prometheus/defaults/main.yml
a8355ca3078663433c90e991a1a9622ae2d5b911696aef4a62701ed6a454690c roles/prometheus/handlers/main.yml
4116ff338c5ffed270d770729ff19e4f0a85365be1745f282fd35f50ca660fd6 roles/prometheus/tasks/main.yml
ec14d6c6a08863e3a2852f6f44454b9371db244c3f330cb26f0d75d113e43c05 roles/prometheus/tasks/main.yml
0851b3c911166154035af002069175750e67611180218be24015b2831e166c24 roles/prometheus/tasks/setup-alertmanager.yml
ab401c6ab6918566be97cb084100c7c60148fc9c90fd856869737d410a6f0600 roles/prometheus/tasks/setup-facts.yml
0f4c1f016548af369cddc1369030d7e8c827091f83d638249b8d36711e60be50 roles/prometheus/tasks/setup-nodeexporter.yml
Expand Down
22 changes: 11 additions & 11 deletions .ansible-sign/sha256sum.txt.sig
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-----BEGIN PGP SIGNATURE-----

iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmVM36AACgkQTiIiIXrU
DNGx/wv/bxBSaWAoaE4FXEwaYQZ7zKRWBrDUM/4QCEL/eB24YU1bnt8eRN1KOSZy
x5rtlUxYZzWnCuNI9d7KDW4ghDwh9wyUl44ElvOFuSUBvhtD1QoW3tMrHybSLml2
J+JIyVfbkFZL6p0IjC5cw1W+Fj2mrGscrEryXfTwVWpx7axLdDQC+/V5P1hiuqyt
EuR54GsmGZcES/Lz7bVXH2QmKxgOsb++IotWKJoMZh5OOaUXwWFb/wxGhMnbWZvN
OgzrDJsoEs8wp58GZycDunYpeTk3bx5QyDGxME74jVOrYQ+9viEK7tz7IjbYtqTC
NxVJxHSKBYV416s0GxLpVAyIMX1hR7euhSB5Bw8S42yXPOKdbjt+CTJWRDtFujxb
tDnSVm2rMIAmyUVZbMjS+E/pN4Spy51aKfUgcgkU5fXYf3HROmmGeX1mqNE2IkGN
QczXaAAdktPlrBDdEOe0SuKcDTR6UMOhw63hQkF4R937q/CRIHbefmWuFGvi7K3V
O1fNl1hO
=OmbS
iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmVM5PgACgkQTiIiIXrU
DNFilgv/cAXM5KutVF2G4KZmc0vhl0oYK/5ssYfj376nwgBvYKS32hCn2G5pv2vt
Ca+5pbFM6T9Cm7C6TN10MXjqByOzGJcNLcCfaSbAZZt2Zy5vcsSqhZ3GVB9zRw7Y
pzNdbEa4B8kh/JK+Z+hiddgHv/xMshzvP+YX3nsxi0tJVzqfD5qLgUNW/hOISaoi
jTPXyZhjAZtbzrB7nC3cvwZOBJlma37UbbfIgVZZ0XUz2ftBlyiP9wXah31Bonr2
UqViXeOmi7+ncHd/T49FBBKkYvnB1WceGo0JGcjC47gr2GdWBilanGOap2ljC+f7
H57H/N0+ci9w2jgOS+BAyPRbNYjCEKdL5ltvurXlHpAYUeLCwmpdW4CWIJ/tBIsh
zWqasmhImtgJZO8+3M6yenOa6Ox3HMrwXmgRTJrbkbFqNtLRFiKpu27JvpY3K1Sc
O8YynI4MZzWMn4HfPRcY6nW5bSxhP490eWp0JxjDGniuRBxtnn1ve5wK1dU9HCZQ
uJP1CsSK
=YHtv
-----END PGP SIGNATURE-----
2 changes: 1 addition & 1 deletion Nodeexporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
vars:
- prometheus_components:
- node_exporter
- nodeexporter_version: 1.6.1
- nodeexporter_version: latest

roles:
- prometheus
6 changes: 3 additions & 3 deletions Promgraf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
- node_exporter
- alertmanager
- tower_scrape: 5m
- prometheus_version: 2.47.2
- alertmanager_version: 0.26.0
- nodeexporter_version: 1.6.1
- prometheus_version: latest
- alertmanager_version: latest
- nodeexporter_version: latest

# If issues arise with grafana yum install, then manually install
# update /etc/yum.repos.d/grafana.repo to the info below
Expand Down
33 changes: 33 additions & 0 deletions roles/prometheus/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,39 @@
- name: "Set role facts"
ansible.builtin.include_tasks: setup-facts.yml

- name: Discover latest version of prometheus
ansible.builtin.set_fact:
prometheus_version: "{{ (lookup('url', 'https://api.github.com/repos/prometheus/prometheus/releases/latest', headers=_github_api_headers,
split_lines=False) | from_json).get('tag_name') | replace('v', '') }}"
run_once: true
until: prometheus_version is version('0.0.0', '>=')
retries: 10
when:
- prometheus_version == "latest"
- '"prometheus" in prometheus_components'

- name: Discover latest version of alertmanager
ansible.builtin.set_fact:
alertmanager_version: "{{ (lookup('url', 'https://api.github.com/repos/prometheus/alertmanager/releases/latest', headers=_github_api_headers,
split_lines=False) | from_json).get('tag_name') | replace('v', '') }}"
run_once: true
until: alertmanager_version is version('0.0.0', '>=')
retries: 10
when:
- alertmanager_version == "latest"
- '"alertmanager" in prometheus_components'

- name: Discover latest version of node exporter
ansible.builtin.set_fact:
nodeexporter_version: "{{ (lookup('url', 'https://api.github.com/repos/prometheus/node_exporter/releases/latest', headers=_github_api_headers,
split_lines=False) | from_json).get('tag_name') | replace('v', '') }}"
run_once: true
until: nodeexporter_version is version('0.0.0', '>=')
retries: 10
when:
- nodeexporter_version == "latest"
- '"node_exporter" in prometheus_components'

- name: "Install Node Exporter"
ansible.builtin.include_tasks: setup-nodeexporter.yml
when: '"node_exporter" in prometheus_components'
Expand Down

0 comments on commit f79db05

Please sign in to comment.