src.nth.io/

summaryrefslogtreecommitdiff
path: root/bitcoind/tasks
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2020-05-12 19:19:36 -0500
committerLuke Hoersten <[email protected]>2020-05-12 19:19:36 -0500
commite15954d16ab8fa98faae42afd828dd2a55324ba7 (patch)
tree7ded7b4876a23720114b019c0682b0a467b645b8 /bitcoind/tasks
parent42436cd2092d53f403b4b59fb77e63ab52fa6356 (diff)
Added bitcoind ansible
Diffstat (limited to 'bitcoind/tasks')
-rw-r--r--bitcoind/tasks/main.yaml61
1 files changed, 61 insertions, 0 deletions
diff --git a/bitcoind/tasks/main.yaml b/bitcoind/tasks/main.yaml
new file mode 100644
index 0000000..53e2e0a
--- /dev/null
+++ b/bitcoind/tasks/main.yaml
@@ -0,0 +1,61 @@
+---
+
+- name: add bitcoind user
+ become: yes
+ user: name="{{bitcoind_user}}"
+
+- name: unarchive bitcoind
+ become: yes
+ unarchive:
+ remote_src: yes
+ src: "{{bitcoind_url}}"
+ dest: "/tmp"
+ creates: "/tmp/bitcoin-{{bitcoind_version}}/"
+
+- name: install bitcoind
+ become: yes
+ copy:
+ src: "/tmp/bitcoin-{{bitcoind_version}}/bin/{{item}}"
+ dest: "/usr/local/bin/"
+ remote_src: yes
+ owner: "root"
+ group: "root"
+ mode: "0755"
+ with_items:
+ - "bitcoind"
+ - "bitcoin-cli"
+
+- name: create bitcoind data dir
+ become: yes
+ file:
+ path: "{{item}}"
+ state: "directory"
+ owner: "{{bitcoind_user}}"
+ group: "{{bitcoind_user}}"
+ mode: "0770"
+ with_items:
+ - "{{bitcoind_data_dir}}"
+ - "{{bitcoind_log_dir}}"
+ - "{{bitcoind_conf_dir}}"
+
+- name: configure bitcoind
+ become: yes
+ template:
+ src: "bitcoin.conf.j2"
+ dest: "{{bitcoind_conf_dir}}/bitcoin.conf"
+ owner: "{{bitcoind_user}}"
+ group: "{{bitcoind_user}}"
+ mode: "0644"
+ notify: restart bitcoind
+
+- name: install bitcoind service
+ become: yes
+ template:
+ src: "bitcoind.service.j2"
+ dest: "/lib/systemd/system/bitcoind.service"
+ mode: "0644"
+ notify: restart bitcoind
+
+- name: ensure bitcoind is started
+ become: yes
+ systemd: service="bitcoind.service" enabled="yes" state="started" daemon_reload="yes"