infra/ansible/roles/bitcoind/tasks/main.yml
2021-01-07 20:02:04 -05:00

54 lines
1,011 B
YAML

---
- 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
src: /dev/sda1
fstype: ext4
opts: defaults
state: present
- 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
mode: 0755
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
...