/deployment-playbooks

Ansible playbooks for deployment POA Network nodes on EC2 or any Linux (Ubuntu 16.04) hosting. Includes master of ceremony, validator, bootnode, explorer, netstat roles

Primary LanguageShellMIT LicenseMIT

Ansible playbook.

Ansible version 2.3 or high.

Before start, you need get AWS access key, please read the instruction:  http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html

Please create file group_vars/all, copy-paste content from all.network (parameters shared by all roles) and add parameters from a specific role file group_vars/*.example

All variables must be set in site.yml (vars section) and group_vars/all file.

Short FAQ:
Q: Where do I find vpc_subnet_id?
A: You can use aws cli to get the variable (https://aws.amazon.com/cli/). Run: aws ec2 describe-subnets and find "AvailabilityZone". with the related "SubnetId": "subnet-XXXXXX"

Q: How to add ssh key pair?
A: Please see: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html

Q: What's the difference between admins.pub and ssh_ROLENAME.pub?
A: File admins.pub contains keys used to access under root and ubuntu (sudo user).File ssh_ROLENAME.pub provides unpriviledged access to a server. If priviledge separation is not required, just use symlink to admins.pub.

Q: When running ec2.yml/site.yml how to verify that everything has completed as expected? Please provide verification steps.
A: ansible-playbooks must pass all steps w/o errors. This means that everything has completed as expected.

Q: Where can I find IMAGE ID for ubuntu LTS?
A: In diffirent regions, ubuntu has unique IMAGE ID. Please see the required IMAGE ID at: https://cloud-images.ubuntu.com/locator/ec2/

Q: What instance type to use?
A: We recommend type m5.large, but you are free to decide. Please see all instance types at: https://aws.amazon.com/ec2/pricing/on-demand/



Usage:
bootnode instance setup: ansible-playbook bootnode.yml
validator instance setup: ansible-playbook validator.yml
netstat instance setup: ansible-playbook netstat.yml
moc instance setup: ansible-playbook moc.yml
explorer instance setup: ansible-playbook explorer.yml

Before setting up instance or refreshing config, add server ip in file hosts and run: ansible-playbook -i hosts site.yml

NOTE:
If you want to close external access to validator, please set variables allow_ssh and allow_p2p to false in group_vars/all and run ansible-playbook validator-access.yml