Verified Commit caae9bc3 authored by Hugo's avatar Hugo
Browse files

store terraform state in minio

parent d01ac9bf
......@@ -8,3 +8,4 @@ kubeconfig
*.log
.env
log
cluster.*.json
\ No newline at end of file
......@@ -19,6 +19,11 @@
proto: tcp
comment: ssh
- set_fact:
cluster: "{{ lookup('file', file_path) | from_json }}"
vars:
file_path: "cluster.{{ lookup('env', 'ENV') }}.json"
- name: allow internal traffic
community.general.ufw:
rule: allow
......
......@@ -11,6 +11,8 @@
set_fact:
cluster: "{{ tf.outputs.cluster.value }}"
- copy: content="{{ cluster }}" dest="cluster.{{ lookup('env', 'ENV') }}.json"
- name: register hosts
add_host:
name: "{{ item.value.publicIp }}"
......
terraform {
backend "s3" {
endpoint = "https://minio.k7.indie.host"
region = "eu"
bucket = "ada-lovelace-cluster-state"
key = "terraform.tfstate"
force_path_style = true
skip_credentials_validation = true
skip_metadata_api_check = true
skip_region_validation = true
access_key = "minio"
workspace_key_prefix = "env"
}
}
variable "hcloud_token" {
description = "Hetzner cloud auth token"
type = string
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment