Files
git/playbooks/provision.yml
Max 3ccd3e5394 fix: issues with scripts, no aws (#4)
Fixes the following issues with the `web/git` Ansible scripts.

- Updates cache before installing `python3-pip`.
- Forces `terraform init` configuration during provisioning.
- Requires user to set an `endpoint_url` to get the backup file from S3.

In addition, I'm removing the last of AWS from the repository:

- The routing uses Hetzner now, so let's get rid of all of that.

Reviewed-on: #4
Co-authored-by: Max <git@maximhutz.me>
Co-committed-by: Max <git@maximhutz.me>
2025-12-31 18:32:27 +00:00

40 lines
1.1 KiB
YAML

- name: Deploy terraform infrastructure.
hosts: localhost
gather_facts: false
vars_files:
- ../vault.yml
tasks:
- name: Reconfigure and plan.
community.general.terraform:
project_path: '../terraform'
state: "planned"
plan_file: plan.out
init_reconfigure: true
force_init: true
backend_config: "{{ terraform.backend }}"
variables: "{{ terraform.variables }}"
complex_vars: true
- name: Apply.
community.general.terraform:
project_path: '../terraform'
state: "present"
plan_file: plan.out
backend_config: "{{ terraform.backend }}"
variables: "{{ terraform.variables }}"
complex_vars: true
register: terraform_apply
- name: Create secret directory.
ansible.builtin.file:
path: ../dist
recurse: true
mode: "0755"
state: directory
- name: Send outputs to file.
ansible.builtin.copy:
content: "{{ terraform_apply.outputs }}"
dest: ../dist/terraform_outputs.yml
mode: '0755'