author | Luke Hoersten <luke@hoersten.org> |
Sun, 07 Jun 2020 11:11:08 -0500 | |
changeset 10 | 26ed67281db6 |
parent 9 | ddf84e986362 |
child 21 | bf53e2eb4d30 |
permissions | -rw-r--r-- |
4 | 1 |
--- |
2 |
||
3 |
- name: add bitcoind user |
|
4 |
become: yes |
|
5 |
user: name="{{bitcoind_user}}" |
|
6 |
||
10 | 7 |
- name: download bitcoind |
4 | 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" |
|
10 | 27 |
notify: restart bitcoind |
4 | 28 |
|
29 |
- name: create bitcoind data dir |
|
30 |
become: yes |
|
31 |
file: |
|
9
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
6
diff
changeset
|
32 |
path: "{{item.path}}" |
4 | 33 |
state: "directory" |
34 |
owner: "{{bitcoind_user}}" |
|
35 |
group: "{{bitcoind_user}}" |
|
9
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
6
diff
changeset
|
36 |
mode: "{{item.mode}}" |
6
e0672e50e2c5
Moved from with_items to loop.
Luke Hoersten <luke@hoersten.org>
parents:
4
diff
changeset
|
37 |
loop: |
9
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
6
diff
changeset
|
38 |
- { path: "{{bitcoind_data_dir}}", mode: "0750" } |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
6
diff
changeset
|
39 |
- { path: "{{bitcoind_log_dir}}", mode: "0750" } |
ddf84e986362
Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents:
6
diff
changeset
|
40 |
- { path: "{{bitcoind_conf_dir}}", mode: "0755" } |
4 | 41 |
|
42 |
- name: configure bitcoind |
|
43 |
become: yes |
|
44 |
template: |
|
45 |
src: "bitcoin.conf.j2" |
|
46 |
dest: "{{bitcoind_conf_dir}}/bitcoin.conf" |
|
47 |
owner: "{{bitcoind_user}}" |
|
48 |
group: "{{bitcoind_user}}" |
|
49 |
mode: "0644" |
|
50 |
notify: restart bitcoind |
|
51 |
||
52 |
- name: install bitcoind service |
|
53 |
become: yes |
|
54 |
template: |
|
55 |
src: "bitcoind.service.j2" |
|
56 |
dest: "/lib/systemd/system/bitcoind.service" |
|
57 |
mode: "0644" |
|
58 |
notify: restart bitcoind |
|
59 |
||
60 |
- name: ensure bitcoind is started |
|
61 |
become: yes |
|
62 |
systemd: service="bitcoind.service" enabled="yes" state="started" daemon_reload="yes" |