refactor(external): just use nvim to edit tfvars

The previous setup using Ansible is kinda unessesary since it just
edit the same tfvars file.
This commit is contained in:
Khue Doan 2024-01-20 11:48:25 +07:00
parent 6def3d1ea7
commit 5915ebb9d1
4 changed files with 12 additions and 24 deletions

View File

@ -6,11 +6,12 @@ default: apply
terraform login
terraform.tfvars:
ansible-playbook tfvars.yml
cp terraform.tfvars.example ${@}
nvim ${@}
.terraform.lock.hcl: ~/.terraform.d/credentials.tfrc.json versions.tf terraform.tfvars
terraform init
touch .terraform.lock.hcl
touch ${@}
namespaces:
ansible-playbook namespaces.yml

View File

@ -0,0 +1,9 @@
# https://dash.cloudflare.com/profile
cloudflare_email = "myaccount@example.com"
# https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids
cloudflare_account_id = "foobarid"
# https://dash.cloudflare.com/profile/api-tokens
cloudflare_api_key = "foobarkey"
# https://my.zerotier.com/account
zerotier_central_token = "foobartoken"

View File

@ -1,4 +0,0 @@
cloudflare_email = "{{ cloudflare_email }}"
cloudflare_api_key = "{{ cloudflare_api_key }}"
cloudflare_account_id = "{{ cloudflare_account_id }}"
zerotier_central_token = "{{ zerotier_central_token }}"

View File

@ -1,18 +0,0 @@
- name: Bootstrap external secrets
hosts: localhost
vars_prompt:
- name: cloudflare_email
prompt: Enter Cloudflare email
private: false
- name: cloudflare_api_key
prompt: Enter Cloudflare API Key (sensitive)
- name: cloudflare_account_id
prompt: Enter Cloudflare account ID
private: false
- name: zerotier_central_token
prompt: Enter ZeroTier Central API Token
tasks:
- name: Render environment file
template:
src: ./terraform.tfvars.j2
dest: ./terraform.tfvars