Sets up some nodes in the Hetzner cloud for demo purposes, using the Hetzner Cloud provider for Terraform.
- Terraform installed
- Hetzner Cloud API token obtained and exported via
export TF_VAR_hcloud_token=<YOUR TOKEN>
- Ansible installed (for provisioning the box with Docker, Java etc.)
- Optional: Vagrant and VirtualBox installed for local set-up
Run this once after a fresh check out:
terraform init
Run this to provision the environment after adjusting the terraform.tf file as needed:
export TF_VAR_firewall_source_ip=`dig +short txt ch whoami.cloudflare @1.0.0.1`
terraform apply
- Edit hosts to contain the right IP address and key file name:
[hetzner]
<hostN> ansible_ssh_private_key_file=path/to/key ssh_public_key_file=path/to/key.pub
- Run once to limit SSH access:
ansible-playbook -i hosts --limit=hetzner init-ssh.yml
- Run to provision more packages:
ansible-playbook -i hosts --limit=hetzner playbook.yml`
This also can be run against EC2, provided an instance has been set up and added to the hosts file. (see https://alt.fedoraproject.org/cloud/, "Standard HVM AMIs"):
Terraform set-up for that tbd.
The Ansible set-up can also be used to provision a local VM via Vagrant and VirtualBox:
vagrant up --provision
Subsequently, Ansible can also be run directly after changes to the playbook:
ansible-playbook -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory playbook.yml