Create a terraform.tfvars file and adjust the settings appropriately. Specifically, you will:
- Choose the appropriate package for your servers
- NOTE: The packages set as the default in the
terraform.tfvars.samplemeet our minimum requirements. We do not recommend going below those, as that may prevent ComputeStacks from booting.
- NOTE: The packages set as the default in the
- Specify how many nodes you want (we recommend 1, 3, or 5). If you need more resources, consider increasing the plan size, or creating multiple availability zones.
- Choose your region
Additionally, please ensure the DigitalOcean project is created prior to running this package.
Copy providers.tf.sample to providers.tf and adjust.
You may wish to automatically configure your DNS records by using a terraform dns provider. Included here is an example file using CloudFlare, dns_cloudflare.tf.sample. You may copy that to dns_cloudflare.tf and adjust accordingly. You will also need to adjust your providers.tf file to include the CloudFlare modules.
By default, you will see the required DNS settings under result/.
Before proceeding, ensure you have terraform installed, and then run:
terraform initterraform applyAfter terraform runs, you will see 2 newly created files under the result/ directory.
dns_settings.txt| Your DNS settings, which must be applied prior to running the ansible package.inventory.yml| You will need this later when configuring Ansible.
During the initial boot process of your new droplets, ansible will be installed. This can take a few minutes to complete.
Please ensure that this process has completed before running the ansible package. You can verify that this is completed by: tail -f /var/log/syslog
For either distribution, you're waiting to see Ansible finish installing. This will be the last step.
You can also confirm the process has completed by ensuring which ansible is successful.
You can use direnv to safely store environmental variables locally in this directory. Once direnv is installed:
mv .envrc.sample .envrc- add your digital ocean token, and;
direnv allow ..
We also recommend installing jq to aid in the presentation of the json data.
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $DO_TOKEN" "https://api.digitalocean.com/v2/sizes" | jq
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $DO_TOKEN" "https://api.digitalocean.com/v2/regions" | jq