To edit values relative to AWS instances, see playbooks/host_vars/ec2-deploy.yaml
Do the following configuration steps on whichever machine is running the playbook.
$ sudo pip install boto
- $ eval ssh-agent && ssh-add ~/.ssh/
- (https://docs.ansible.com/ansible/2.6/scenario_guides/guide_aws.html#authentication)
- $ export AWS_ACCESS_KEY_ID='AK123'
- $ export AWS_SECRET_ACCESS_KEY='abc123'
NOTE: Dynamic inventories are not used for now, so this step is optional.
NOTE: Dynamic inventories are not used for now, so this step is optional.
- $ ansible -u ec2-user -m ping tag_Name_your_tag_name
To deploy 3 aws ec2 instances:
ansible-playbook -i inventories/aws playbooks/cluster-up.yaml -e "tag_name=<some name>"
Optionally, to change the number of instances, set the num_nodes
var:
ansible-playbook playbooks/cluster-up.yaml -e "tag_name=<some name> num_nodes=42"
To tear down all clusters with the same Name:
tag:
ansible-playbook playbooks/cluster-down.yaml -e "tag_name=<some name>"