Initial commit

This commit is contained in:
Matt Smith 2020-08-04 23:23:26 +01:00
commit 3ca64f164d
No known key found for this signature in database
GPG key ID: D0EAC8943FB1B2C1
13 changed files with 196 additions and 0 deletions

View file

@ -0,0 +1,8 @@
---
wownerod_remote_url: "https://distfiles.offtopica.uk/wownerod-0.8.0.2"
wownerod_remote_hash: "sha256:ac7bba8924d43dfc9e9cf868737ebebc68591fdc17273cd0b3b9216e959fb0bc"
wownero_version: "0.8.0.2"
wownero_bin_dir: "/usr/local/bin"
wownerod_path: "{{ wownero_bin_dir }}/wownerod"
wownerod_p2p_port: "34567"
wownerod_rpc_port: "34568"

View file

@ -0,0 +1,6 @@
---
- name: restart wownerod
systemd:
daemon_reload: yes
name: wownerod.service
state: restarted

View file

@ -0,0 +1,11 @@
---
- name: Download release binary
get_url:
url: "{{ wownerod_remote_url }}"
dest: "{{ wownerod_path }}"
checksum: "{{ wownerod_remote_hash }}"
owner: root
group: root
mode: '0755'
notify:
- restart wownerod

View file

@ -0,0 +1,65 @@
---
- name: Install ufw
apt: name=ufw state=present
tags: firewall
- name: Limit ssh
ufw: rule=limit port=ssh proto=tcp
tags: firewall
- name: Enable ufw
ufw: state=enabled
tags: firewall
- name: Check if wownerod is installed
stat: path="{{ wownerod_path }}"
register: stat_wownerod_path
- name: Check wownerod version
command: "{{ wownerod_path }} --version"
register: wownerod_version_cmd
when: stat_wownerod_path.stat.exists
- name: Parse wownerod version
set_fact:
installed_wownerod_version: "{{ wownerod_version_cmd.stdout | regex_search('\\d+\\.\\d+\\.\\d+\\.\\d') }}"
when: stat_wownerod_path.stat.exists
- name: Install wownerod
import_tasks: install.yaml
when: not stat_wownerod_path.stat.exists or not installed_wownerod_version == wownero_version
- name: Create wownero user
user:
name: wownero
create_home: no
home: /var/lib/wownero
shell: /bin/false
system: yes
- name: Install systemd unit file
template:
src: wownerod.service.j2
dest: /etc/systemd/system/wownerod.service
owner: root
group: root
mode: '0644'
notify:
- restart wownerod
- name: Install wownerod config file
template:
src: wownerod.conf.j2
dest: /etc/wownerod.conf
owner: root
group: root
mode: '0644'
notify:
- restart wownerod
- name: Allow wownerod p2p port
ufw:
rule: allow
port: "{{ wownerod_p2p_port }}"
proto: tcp
tags: firewall
- name: Allow wownerod rpc port
ufw:
rule: allow
port: "{{ wownerod_rpc_port }}"
proto: tcp
tags: firewall
- name: Enable wownerod service
systemd:
name: wownerod.service
enabled: true

View file

@ -0,0 +1,14 @@
check-updates=disabled
confirm-external-bind=1
data-dir=/var/lib/wownero
log-file=/var/log/wownero/wownerod.log
log-level=0
no-igd=1
p2p-bind-port={{ wownerod_p2p_port }}
p2p-use-ipv6=1
public-node=1
restricted-rpc=1
rpc-bind-ip=0.0.0.0
rpc-bind-ipv6-address=::0
rpc-bind-port={{ wownerod_rpc_port }}
rpc-use-ipv6=1

View file

@ -0,0 +1,17 @@
[Unit]
Description=Wownero Full Node
After=network-online.target
Wants=network-online.target
[Service]
User=wownero
Group=wownero
Environment="MONERO_RANDOMX_UMASK=1"
StateDirectory=wownero
LogsDirectory=wownero
Type=simple
PIDFile=/run/wownero/wownerod.pid
ExecStart={{ wownerod_path }} --config-file /etc/wownerod.conf --non-interactive
[Install]
WantedBy=multi-user.target