diff options
| -rw-r--r-- | bitcoind-prometheus-exporter/tasks/main.yaml | 10 | ||||
| -rw-r--r-- | bitcoind/tasks/main.yaml | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/bitcoind-prometheus-exporter/tasks/main.yaml b/bitcoind-prometheus-exporter/tasks/main.yaml index 59eed2f..5792252 100644 --- a/bitcoind-prometheus-exporter/tasks/main.yaml +++ b/bitcoind-prometheus-exporter/tasks/main.yaml @@ -12,6 +12,16 @@ - "prometheus_client" - "python-bitcoinlib" +# The exporter reads rpc credentials from bitcoin.conf, which the bitcoind +# role keeps at 0640 bitcoin:bitcoin. +- name: add prometheus user to the bitcoin group + become: yes + user: + name: "prometheus" + groups: "{{bitcoind_user | default('bitcoin')}}" + append: yes + notify: restart service + - name: unarchive bitcoind-prometheus-exporter become: yes unarchive: diff --git a/bitcoind/tasks/main.yaml b/bitcoind/tasks/main.yaml index a11dbbf..f99256c 100644 --- a/bitcoind/tasks/main.yaml +++ b/bitcoind/tasks/main.yaml @@ -49,7 +49,9 @@ dest: "{{bitcoind_conf_dir}}/bitcoin.conf" owner: "{{bitcoind_user}}" group: "{{bitcoind_user}}" - mode: "0600" + # group-readable: the prometheus exporter reads rpc credentials from this + # file (its role adds the prometheus user to the bitcoin group) + mode: "0640" notify: restart bitcoind no_log: true |
