nucypher/deploy/ansible/geth/launch_nodes.yml

78 lines
2.1 KiB
YAML

---
- hosts: "{{ 'tag_Role_' + lookup('env', 'NUCYPHER_NETWORK_NAME') + '_bootnodes' }}"
name: "GatherBootnode Facts"
user: ubuntu
tasks: [ ]
- name: "Launch Geth Nodes"
hosts: "{{ 'tag_Role_' + lookup('env', 'NUCYPHER_NETWORK_NAME') + '_miners' }}"
user: ubuntu
gather_facts: false
pre_tasks:
- name: "Install Python2.7 for Ansible Control"
raw: sudo apt -y update && sudo apt install -y python2.7-minimal python2.7-setuptools
tasks:
- name: "Register Ethereum PPA"
become: yes
become_flags: "-H -S"
apt_repository:
repo: 'ppa:ethereum/ethereum'
state: present
- name: "Install System Dependencies"
become: yes
become_flags: "-H -S"
apt:
name: "{{ packages }}"
update_cache: yes
vars:
packages:
- python-pip
- python3
- python3-pip
- python3-dev
- python3-setuptools
- libffi-dev
- software-properties-common
- ethereum
- npm
- name: Install "PM2" node.js package globally
become: yes
become_flags: "-H -S"
npm:
name: pm2
global: yes
- name: "Render Geth Node Service"
become: yes
become_flags: "-H -S"
template:
src: ../../services/geth_miner.j2
dest: /etc/systemd/system/geth_miner.service
mode: 0755
vars:
datadir: "/home/ubuntu/chaindata"
networkid: "112358"
rpchost: "localhost"
syncmode: "full"
nickname: "NuCypher-Testnet-{{ hostvars[inventory_hostname].ec2_tag_Name }}"
eth_netstats_secret: "{{ lookup('env', 'ETH_NETSTATS_SECRET') }}"
eth_netstats_ip: "{{ hostvars[groups['tag_Role_' + lookup('env', 'NUCYPHER_NETWORK_NAME') + '_eth_netstats'][0]].ansible_host }}"
eth_netstats_port: "3000"
bootnode_uri: "{{ lookup('file', './files/bootnodes.txt') }}"
- name: "Enable and Start Geth Node Service"
become: yes
become_flags: "-H -S"
systemd:
daemon_reload: yes
no_block: yes
enabled: yes
state: restarted
name: "geth_miner"