Skip to content

Provision new machine

cintiadr edited this page Sep 18, 2017 · 32 revisions

Note: Jetstream migration guidelines in here

Terraform

  • Use terraform to provision new machine and run ansible. Use ./build create <machine> to start new terraform stack. Review variables.tf file. Use ./build plan <machine> to check changes and ./build apply <machine> to create the machine and its resources.
    • If the machine should have backups, change variable has_backup to true and uncomment outputs. Check Backups Strategy for details.
    • Create a terraform resource 'dme_record' for each DNS record it'll be using. Each application/port publicly accessible should be using a different DNS record, as we aim to only use port 443 for all our web applications.
    • Modify terraform variable update_os to true, and apply terraform again to update packages.

At this point, machine will be only accessible using root/terraform private key

Ansible (first run)

  • Create machine definition in ansible. Add machine to relevant inventory file and create host var files in ansible.
  • If the machine should have a docker apps, follow this guide to check all requirements
  • If the machine should have backups, add to backups group and add outputs from terraform as aws variables in host_var file.
  • Secrets should go to vault file, and should be encrypted using ansible-vault
  • Commit and push changes to github
  • Modify terraform variable use_ansible to true, and run ./build plan <machine> and ./build apply <machine>

Monitoring

  • Verify alerts in datadog
  • Add monitoring in pingdom and status.io (only if production)
  • Add machine to Server inventory and add its service to this wiki

Clone this wiki locally