author | Luke Hoersten <luke@hoersten.org> |
Mon, 07 Oct 2024 23:30:59 -0500 | |
changeset 36 | 8de33340cca9 |
parent 35 | f7dc2fa74e74 |
permissions | -rw-r--r-- |
9
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
1 |
--- |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
2 |
|
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
3 |
- name: apt-get bitcoind-prometheus-exporter install deps |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
4 |
become: yes |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
5 |
apt: name="python3-pip" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
6 |
|
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
7 |
- name: pip bitcoind-prometheus-exporter install deps |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
8 |
become: yes |
35 | 9 |
pip: name="{{item}}" break_system_packages="true" |
9
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
10 |
loop: |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
11 |
- "riprova" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
12 |
- "prometheus_client" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
13 |
- "python-bitcoinlib" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
14 |
|
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
15 |
- name: unarchive bitcoind-prometheus-exporter |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
16 |
become: yes |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
17 |
unarchive: |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
18 |
remote_src: yes |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
19 |
src: "{{bitcoind_prometheus_exporter_url}}" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
20 |
dest: "/tmp" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
21 |
creates: "/tmp/{{bitcoind_prometheus_exporter_tar_name}}/" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
22 |
notify: restart service |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
23 |
|
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
24 |
- name: install bitcoind-prometheus-exporter |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
25 |
become: yes |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
26 |
copy: |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
27 |
src: "/tmp/{{bitcoind_prometheus_exporter_tar_name}}/bitcoind-monitor.py" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
28 |
dest: "/usr/local/bin/bitcoind-prometheus-exporter.py" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
29 |
remote_src: yes |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
30 |
owner: "root" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
31 |
group: "root" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
32 |
mode: "0755" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
33 |
changed_when: false |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
34 |
|
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
35 |
- name: install bitcoind-prometheus-exporter service |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
36 |
become: yes |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
37 |
template: |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
38 |
src: "bitcoind-prometheus-exporter.service.j2" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
39 |
dest: "/lib/systemd/system/bitcoind-prometheus-exporter.service" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
40 |
mode: "0644" |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
41 |
notify: restart service |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
42 |
|
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
43 |
- name: ensure bitcoind-prometheus-exporter service is started |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
44 |
become: yes |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
45 |
systemd: service="bitcoind-prometheus-exporter.service" enabled="yes" state="started" daemon_reload="yes" |