author | Luke Hoersten <luke@hoersten.org> |
Sat, 16 May 2020 17:59:15 -0500 | |
changeset 9 | ddf84e986362 |
parent 6 | e0672e50e2c5 |
child 10 | 26ed67281db6 |
permissions | -rw-r--r-- |
4 | 1 |
--- |
2 |
||
3 |
- name: add bitcoind user |
|
4 |
become: yes |
|
5 |
user: name="{{bitcoind_user}}" |
|
6 |
||
7 |
- name: unarchive bitcoind |
|
8 |
become: yes |
|
9 |
unarchive: |
|
10 |
remote_src: yes |
|
11 |
src: "{{bitcoind_url}}" |
|
12 |
dest: "/tmp" |
|
13 |
creates: "/tmp/bitcoin-{{bitcoind_version}}/" |
|
14 |
||
15 |
- name: install bitcoind |
|
16 |
become: yes |
|
17 |
copy: |
|
18 |
src: "/tmp/bitcoin-{{bitcoind_version}}/bin/{{item}}" |
|
19 |
dest: "/usr/local/bin/" |
|
20 |
remote_src: yes |
|
21 |
owner: "root" |
|
22 |
group: "root" |
|
23 |
mode: "0755" |
|
6
e0672e50e2c5
Moved from with_items to loop.
Luke Hoersten <luke@hoersten.org>
parents:
4
diff
changeset
|
24 |
loop: |
4 | 25 |
- "bitcoind" |
26 |
- "bitcoin-cli" |
|
27 |
||
28 |
- name: create bitcoind data dir |
|
29 |
become: yes |
|
30 |
file: |
|
9
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
6
diff
changeset
|
31 |
path: "{{item.path}}" |
4 | 32 |
state: "directory" |
33 |
owner: "{{bitcoind_user}}" |
|
34 |
group: "{{bitcoind_user}}" |
|
9
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
6
diff
changeset
|
35 |
mode: "{{item.mode}}" |
6
e0672e50e2c5
Moved from with_items to loop.
Luke Hoersten <luke@hoersten.org>
parents:
4
diff
changeset
|
36 |
loop: |
9
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
6
diff
changeset
|
37 |
- { path: "{{bitcoind_data_dir}}", mode: "0750" } |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
6
diff
changeset
|
38 |
- { path: "{{bitcoind_log_dir}}", mode: "0750" } |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
6
diff
changeset
|
39 |
- { path: "{{bitcoind_conf_dir}}", mode: "0755" } |
4 | 40 |
|
41 |
- name: configure bitcoind |
|
42 |
become: yes |
|
43 |
template: |
|
44 |
src: "bitcoin.conf.j2" |
|
45 |
dest: "{{bitcoind_conf_dir}}/bitcoin.conf" |
|
46 |
owner: "{{bitcoind_user}}" |
|
47 |
group: "{{bitcoind_user}}" |
|
48 |
mode: "0644" |
|
49 |
notify: restart bitcoind |
|
50 |
||
51 |
- name: install bitcoind service |
|
52 |
become: yes |
|
53 |
template: |
|
54 |
src: "bitcoind.service.j2" |
|
55 |
dest: "/lib/systemd/system/bitcoind.service" |
|
56 |
mode: "0644" |
|
57 |
notify: restart bitcoind |
|
58 |
||
59 |
- name: ensure bitcoind is started |
|
60 |
become: yes |
|
61 |
systemd: service="bitcoind.service" enabled="yes" state="started" daemon_reload="yes" |