105 lines
2.4 KiB
YAML
105 lines
2.4 KiB
YAML
|
|
---
|
||
|
|
- name: Calculate dbcache as a share of system RAM
|
||
|
|
set_fact:
|
||
|
|
bitcoin_dbcache_mb: "{{ (ansible_memtotal_mb | float * 0.9) | int }}"
|
||
|
|
when: bitcoin_dbcache_mb_override | string | length == 0
|
||
|
|
|
||
|
|
- name: Use the explicit dbcache override
|
||
|
|
set_fact:
|
||
|
|
bitcoin_dbcache_mb: "{{ bitcoin_dbcache_mb_override }}"
|
||
|
|
when: bitcoin_dbcache_mb_override | string | length > 0
|
||
|
|
changed_when: false
|
||
|
|
|
||
|
|
- name: Display calculated dbcache value
|
||
|
|
debug:
|
||
|
|
msg: "Setting dbcache to {{ bitcoin_dbcache_mb }} MB (90% of {{ ansible_memtotal_mb }} MB total RAM)"
|
||
|
|
|
||
|
|
|
||
|
|
- name: Install build dependencies
|
||
|
|
apt:
|
||
|
|
name:
|
||
|
|
- build-essential
|
||
|
|
- libtool
|
||
|
|
- autotools-dev
|
||
|
|
- automake
|
||
|
|
- pkg-config
|
||
|
|
- bsdmainutils
|
||
|
|
- python3
|
||
|
|
- python3-pip
|
||
|
|
- libevent-dev
|
||
|
|
- libboost-system-dev
|
||
|
|
- libboost-filesystem-dev
|
||
|
|
- libboost-test-dev
|
||
|
|
- libboost-thread-dev
|
||
|
|
- libboost-chrono-dev
|
||
|
|
- libboost-program-options-dev
|
||
|
|
- libboost-dev
|
||
|
|
- libssl-dev
|
||
|
|
- libdb-dev
|
||
|
|
- libminiupnpc-dev
|
||
|
|
- libzmq3-dev
|
||
|
|
- libnatpmp-dev
|
||
|
|
- libsqlite3-dev
|
||
|
|
- git
|
||
|
|
- curl
|
||
|
|
- wget
|
||
|
|
- cmake
|
||
|
|
state: present
|
||
|
|
update_cache: yes
|
||
|
|
|
||
|
|
- name: Create bitcoin group
|
||
|
|
group:
|
||
|
|
name: "{{ bitcoin_group }}"
|
||
|
|
system: yes
|
||
|
|
state: present
|
||
|
|
|
||
|
|
- name: Create bitcoin user
|
||
|
|
user:
|
||
|
|
name: "{{ bitcoin_user }}"
|
||
|
|
group: "{{ bitcoin_group }}"
|
||
|
|
system: yes
|
||
|
|
shell: /usr/sbin/nologin
|
||
|
|
home: "{{ bitcoin_data_dir }}"
|
||
|
|
create_home: yes
|
||
|
|
state: present
|
||
|
|
|
||
|
|
- name: Create bitcoin-knots directory
|
||
|
|
file:
|
||
|
|
path: "{{ bitcoin_knots_dir }}"
|
||
|
|
state: directory
|
||
|
|
owner: root
|
||
|
|
group: root
|
||
|
|
mode: '0755'
|
||
|
|
|
||
|
|
- name: Create bitcoin-knots source directory
|
||
|
|
file:
|
||
|
|
path: "{{ bitcoin_knots_source_dir }}"
|
||
|
|
state: directory
|
||
|
|
owner: root
|
||
|
|
group: root
|
||
|
|
mode: '0755'
|
||
|
|
|
||
|
|
- name: Create bitcoin data directory (for config, logs, wallets)
|
||
|
|
file:
|
||
|
|
path: "{{ bitcoin_data_dir }}"
|
||
|
|
state: directory
|
||
|
|
owner: "{{ bitcoin_user }}"
|
||
|
|
group: "{{ bitcoin_group }}"
|
||
|
|
mode: '0750'
|
||
|
|
|
||
|
|
- name: Create bitcoin large data directory (for blockchain)
|
||
|
|
file:
|
||
|
|
path: "{{ bitcoin_large_data_dir }}"
|
||
|
|
state: directory
|
||
|
|
owner: "{{ bitcoin_user }}"
|
||
|
|
group: "{{ bitcoin_group }}"
|
||
|
|
mode: '0750'
|
||
|
|
|
||
|
|
- name: Create bitcoin config directory
|
||
|
|
file:
|
||
|
|
path: "{{ bitcoin_conf_dir }}"
|
||
|
|
state: directory
|
||
|
|
owner: root
|
||
|
|
group: root
|
||
|
|
mode: '0755'
|