Process documentation
...
bundle exec cap staging maintenance:enable REASON="a test of maintenance mode" UNTIL="12pm Eastern Time"
- Deploy as usual / desired
- Do anything else needed on the server that required the downtime
bundle exec cap staging maintenance:disable
...
- (Note: ansible-vault password and all current AWS keys are in shared network drive)
- Generate a new ssh key on AWS (EC2 > Keypairs)
- place it in ~/.ssh
- chmod 0600.
- useful command if you're having problems with the key: $ openssl rsa -in chf_prod.pem -check
- Check ansible variables
- $ ansible-vault edit group_vars/all
- look Look for "# CHANGE PER INSTANCE" comments# Use these temporarily for new instances
- ensure your ssh keys key is listed under keys_to_add
- run the ansible playbook
- $ ansible-playbook -i hosts create_ec2.yml --private-key=/Users/aheadley/.ssh/chf_prod.pem --ask-vault-pass
- OR, if you're re-running scripts on an existing machine:
- $ ansible-playbook -i hosts [playbook] --ask-vault-pass
- note that if there's a failure during postgres setup handlers may not run – watch out for this. if this happens it's potentially best to start over completely.
- Assign an elastic IP to the new box
- Ask IT to give you a DNS entry for the elastic IP if desired
- Consider naming the aws volumes for 'root' and 'data' – this isn't done in the scripts (but probably could be!)
- Set up to use capistrano (below) or just deploy with capistrano (above)
...