Central documentation for Personal Infra project.
Project documentation (this repository)
- Infra Docs: https://github.com/N0zz/infra-docs
Terraform variables for different projects/environments. Terraform cloud uses those repo to run terraform. Utilizes modules listed below.
Terraform modules responsible for creating resources. Used by Terraform Projects listed above.
- OVH: https://github.com/N0zz/infra-tfmod-ovh
- UptimeRobot: https://github.com/N0zz/infra-tfmod-uptimerobot
- CloudFlare: https://github.com/N0zz/infra-tfmod-cloudflare
Ansible ansible.cfg, inventory, roles and playboks, as well as ansible docker runner to keep everything neat.
Required ENV variables in Terraform Run Environment.
https://registry.terraform.io/providers/ovh/ovh/latest/docs#provider-configuration
https://www.ovh.com/auth/api/createToken
Variables:
- OVH_APPLICATION_KEY
- OVH_APPLICATION_SECRET
- OVH_CONSUMER_KEY
- OVH_ENDPOINT
https://registry.terraform.io/providers/vexxhost/uptimerobot/latest/docs#configuration-reference
https://uptimerobot.com/dashboard#mySettings
Variables:
- UPTIMEROBOT_API_KEY
https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs#api_token
https://dash.cloudflare.com/profile/api-tokens
Variables:
- CLOUDFLARE_API_TOKEN
All Terraform (tf/tfmod) repositories should have configured .git/hooks/pre-commit
to run:
terraform fmt
tflint
terraform-docs
To ensure repo quality and update README.md
automatically.
On mac systems it should be sufficient to install them via brew:
$ brew install terraform terraform-docs tflint
$ brew list | grep 'tflint\|terraform'
terraform
terraform-docs
tflint
To install brew reffer to https://brew.sh/ website.
VARs described in ENV Variables.
- Debian / Ubuntu System
- Ansible public ssh key added for default system user
- Open ports 80 and 443 for web_server VMs
Inside Terraform Projects repositories in variables.tf
update old IP addresses.
To create/update DNS records, uptimerobot monitors and alerts.
Update ansible inventory/hosts
with new hosts data (names/ips/users) in Ansible
repository (repositories).
*This step is to be automated
Playbooks:
- play/setup.yml
- play/base.yml
- play/personalize.yml
After Terraform creates alert contacts, UptimeRobot sends confirmation link.