Skip to content

Commit

Permalink
deploy conf in data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mvrahden committed Apr 22, 2024
1 parent 2f28580 commit f33e943
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
20 changes: 2 additions & 18 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,26 +120,10 @@
notify:
- Bitcoind | Ensure bitcoind systemd unit is restarted

- name: "Bitcoind | Ensure Bitcoin configuration directory exists ('/etc/bitcoind/{{ bitcoind_network }}')"
ansible.builtin.file:
path: /etc/bitcoind/{{ bitcoind_network }}
state: directory
owner: "{{ bitcoind_user }}"
group: "{{ bitcoind_group }}"
mode: "0755"

- name: "Bitcoind | Ensure symbolic link from '/etc/bitcoind/{{ bitcoind_network }}' to '/home/{{ bitcoind_user }}/.bitcoin' exists"
ansible.builtin.file:
src: /etc/bitcoind/{{ bitcoind_network }}
dest: /home/{{ bitcoind_user }}/.bitcoin
state: link
owner: "{{ bitcoind_user }}"
group: "{{ bitcoind_group }}"

- name: "Bitcoind | Copy bitcoin.conf file into '/etc/bitcoind/{{ bitcoind_network }}'"
- name: "Bitcoind | Copy bitcoin.conf file into '{{ bitcoind_data_dir }}/bitcoind.conf'"
ansible.builtin.template:
src: bitcoin.conf.j2
dest: /etc/bitcoind/{{ bitcoind_network }}/bitcoind.conf
dest: "{{ bitcoind_data_dir }}/bitcoind.conf"
owner: "{{ bitcoind_user }}"
group: "{{ bitcoind_group }}"
notify:
Expand Down
6 changes: 3 additions & 3 deletions templates/bitcoind.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Wants=network-online.target

[Service]
ExecStart=/usr/local/bin/bitcoind -daemonwait \
-conf=/etc/bitcoind/{{ bitcoind_network }}/bitcoind.conf \
-conf={{ bitcoind_data_dir }}/bitcoind.conf \

# Make sure the config directory is readable by the service user
PermissionsStartOnly=true
Expand Down Expand Up @@ -48,8 +48,8 @@ Group={{ bitcoind_group }}
RuntimeDirectory=bitcoind/{{ bitcoind_network }}
RuntimeDirectoryMode=0710

# /etc/bitcoind/{{ bitcoind_network }}
ConfigurationDirectory=bitcoind/{{ bitcoind_network }}
# {{ bitcoind_data_dir }}
ConfigurationDirectory={{ bitcoind_data_dir }}
ConfigurationDirectoryMode=0755

# /var/lib/bitcoind
Expand Down

0 comments on commit f33e943

Please sign in to comment.