bitcoind-prometheus-exporter/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sun, 30 Aug 2020 14:07:47 -0500
changeset 13 f052a25a2f96
parent 9 ddf84e986362
child 35 f7dc2fa74e74
permissions -rw-r--r--
Update to bitcoind 0.20.1 and lnd 0.11.0

---

- name: apt-get bitcoind-prometheus-exporter install deps
  become: yes
  apt: name="python3-pip"

- name: pip bitcoind-prometheus-exporter install deps
  become: yes
  pip: name="{{item}}"
  loop:
    - "riprova"
    - "prometheus_client"
    - "python-bitcoinlib"

- name: unarchive bitcoind-prometheus-exporter
  become: yes
  unarchive:
    remote_src: yes
    src: "{{bitcoind_prometheus_exporter_url}}"
    dest: "/tmp"
    creates: "/tmp/{{bitcoind_prometheus_exporter_tar_name}}/"
  notify: restart service

- name: install bitcoind-prometheus-exporter
  become: yes
  copy:
    src: "/tmp/{{bitcoind_prometheus_exporter_tar_name}}/bitcoind-monitor.py"
    dest: "/usr/local/bin/bitcoind-prometheus-exporter.py"
    remote_src: yes
    owner: "root"
    group: "root"
    mode: "0755"
  changed_when: false

- name: install bitcoind-prometheus-exporter service
  become: yes
  template:
    src: "bitcoind-prometheus-exporter.service.j2"
    dest: "/lib/systemd/system/bitcoind-prometheus-exporter.service"
    mode: "0644"
  notify: restart service

- name: ensure bitcoind-prometheus-exporter service is started
  become: yes
  systemd: service="bitcoind-prometheus-exporter.service" enabled="yes" state="started" daemon_reload="yes"