infra/ansible/roles/bitcoind/tasks/main.yml

55 lines
1 KiB
YAML
Raw Normal View History

2021-01-08 01:02:04 +00:00
---
- name: create bitcoind group
group:
name: bitcoind
state: present
- name: create bitcoind user
user:
name: bitcoind
group: bitcoind
state: present
shell: /bin/bash
home: /home/bitcoind
- name: ensure bitcoind config directory exists
file:
path: /home/bitcoind/.bitcoin
state: directory
owner: bitcoind
group: bitcoind
mode: '0750'
- name: ensure bitcoind mount exists
mount:
path: /home/bitcoind/.bitcoin
2021-01-08 02:24:11 +00:00
src: '{{ bitcoind_disk }}'
2021-01-08 01:02:04 +00:00
fstype: ext4
opts: defaults
state: present
2021-01-08 02:24:11 +00:00
when: bitcoind_disk is defined
2021-01-08 01:02:04 +00:00
- name: install bitcoind
apt:
name: bitcoind
state: present
- name: ensure bitcoind service file exists
copy:
src: files/bitcoind.service
dest: /etc/systemd/system/bitcoind.service
2023-07-10 23:12:14 +00:00
mode: 0750
2021-01-08 01:02:04 +00:00
owner: root
group: root
notify: reload systemd
- name: flush handlers for systemd reloading
meta: flush_handlers
- name: ensure bitcoind is enabled and started
systemd:
name: bitcoind
state: started
enabled: True
...