From af7c1c922ddbd5dd1687f2ea4b612a6ebae0ba6b Mon Sep 17 00:00:00 2001 From: Max Kratz Date: Fri, 7 Jul 2023 19:42:24 +0200 Subject: [PATCH] Adds doc how to build the staging environment with terraform + ansible --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 9329a29..88c5589 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,14 @@ Terraform is used to create the infrastructure (VMs) and run a basic provisionin - To destroy the infrastructure, run: - `$ terraform destroy -var-file="secrets.tfvars"` +### Staging + +- To create the infrastructure, run: + - `$ terraform plan -var-file="secrets.tfvars" -target=hcloud_server.staging` + - `$ terraform apply -var-file="secrets.tfvars" -target=hcloud_server.staging` +- To destroy the infrastructure, run: + - `$ terraform destroy -var-file="secrets.tfvars" -target=hcloud_server.staging` + ## Ansible @@ -44,6 +52,13 @@ Ansible is used to configure the VMs and create/configure all necessary services - `$ ansible-galaxy install -r requirements.yml` - `$ ansible-playbook playbook.yml` +### Staging + +- To create/configure/update all services only on the staging VM, run: + - `$ export ANSIBLE_CONFIG=./ansible.cfg` + - `$ ansible-galaxy install -r requirements.yml` + - `$ ansible-playbook playbook.yaml --limit staging` + ### Ansible Lint - Installation: `$ pip3 install ansible-lint`