132 lines
3.5 KiB
YAML
132 lines
3.5 KiB
YAML
---
|
|
- 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
|
|
- name: Install tor
|
|
apt: name=tor state=present
|
|
- name: Install tor config file
|
|
template:
|
|
src: torrc.j2
|
|
dest: /etc/tor/torrc
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify:
|
|
- restart tor
|
|
- name: Install i2pd
|
|
apt: name=i2pd state=present
|
|
- name: Install i2pd tunnels.conf
|
|
template:
|
|
src: tunnels.conf.j2
|
|
dest: /etc/i2pd/tunnels.conf
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify:
|
|
- restart i2pd
|
|
- name: Flush handlers
|
|
meta: flush_handlers
|
|
- name: Pause 1 minute for b32.i2p creation
|
|
pause:
|
|
minutes: 1
|
|
|
|
- name: get i2p p2p
|
|
shell: curl http://127.0.0.1:7070/?page=i2p_tunnels 2>&1 | grep -Eo "[a-zA-Z0-9./?=_%:-]*" | grep "34565"
|
|
register: i2pinsert
|
|
- name: add i2p inbound wownerod.conf
|
|
lineinfile:
|
|
dest: /etc/wownerod.conf
|
|
line: "anonymous-inbound={{ i2pinsert.stdout }},127.0.0.1:{{ wownerod_p2p_i2p_port }},64"
|
|
notify:
|
|
- restart wownerod
|
|
|
|
- name: get onion hostname
|
|
slurp:
|
|
src: /var/lib/tor/wownero/hostname
|
|
register: onionhost
|
|
- name: echo onion
|
|
shell: echo {{ onionhost['content'] | b64decode }}
|
|
register: onionhostinsert
|
|
- name: add tor inbound wownerod.conf
|
|
lineinfile:
|
|
dest: /etc/wownerod.conf
|
|
line: "anonymous-inbound={{ onionhostinsert.stdout }}:{{ wownerod_p2p_tor_port }},127.0.0.1:{{ wownerod_p2p_tor_port }},64"
|
|
notify:
|
|
- restart wownerod
|
|
- name: Flush handlers
|
|
meta: flush_handlers
|
|
- name: get i2p rpc hostname
|
|
shell: curl http://127.0.0.1:7070/?page=i2p_tunnels 2>&1 | grep -Eo "[a-zA-Z0-9./?=_%:-]*" | grep "34568"
|
|
register: i2phost
|
|
- name: show b32 i2p and onion
|
|
debug:
|
|
msg:
|
|
- "ADD RPC URLs TO https://MONERO.FAIL/?crypto=wownero"
|
|
- "YOUR I2P P2P ADDRESS :"
|
|
- "{{ i2pinsert.stdout }}"
|
|
- "YOUR I2P RPC ADDRESS :"
|
|
- "{{ i2phost.stdout }}"
|
|
- "YOUR TOR P2P/RPC ADDRESS:"
|
|
- "{{ onionhost['content'] | b64decode }}"
|