Move inventory back into root directory

This commit is contained in:
Tobias Reisinger 2024-10-18 01:34:55 +02:00
parent b5ddefbd90
commit 0c60e974a2
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
6 changed files with 11 additions and 9 deletions

6
.gitignore vendored
View file

@ -7,8 +7,8 @@ dns/services.json
secrets.auto.tfvars secrets.auto.tfvars
.terraform .terraform
playbooks/inventory/group_vars/all/serguzim.net.yml inventory/group_vars/all/serguzim.net.yml
playbooks/inventory/group_vars/all/opentofu.yml inventory/group_vars/all/opentofu.yml
playbooks/inventory/group_vars/all/all_services.yml inventory/group_vars/all/all_services.yml
infrastructure.svg infrastructure.svg

View file

@ -9,28 +9,28 @@ PWD := $(shell pwd)
.FORCE: .FORCE:
./playbooks/inventory/group_vars/all/all_services.yml: .FORCE ./inventory/group_vars/all/all_services.yml: .FORCE
tofu output --json \ tofu output --json \
| yq -y '{all_services: with_entries(.value |= .value).services | to_entries | map(.value)}' \ | yq -y '{all_services: with_entries(.value |= .value).services | to_entries | map(.value)}' \
> ./playbooks/inventory/group_vars/all/all_services.yml > ./inventory/group_vars/all/all_services.yml
./playbooks/inventory/group_vars/all/opentofu.yml: .FORCE ./inventory/group_vars/all/opentofu.yml: .FORCE
tofu output --json \ tofu output --json \
| yq -y '{opentofu: with_entries(.value |= .value)}' \ | yq -y '{opentofu: with_entries(.value |= .value)}' \
> ./playbooks/inventory/group_vars/all/opentofu.yml > ./inventory/group_vars/all/opentofu.yml
./dns/hosts.json: .FORCE ./dns/hosts.json: .FORCE
tofu output --json \ tofu output --json \
| jq 'with_entries(.value |= .value).hosts' \ | jq 'with_entries(.value |= .value).hosts' \
> ./dns/hosts.json > ./dns/hosts.json
./dns/services.json: ./playbooks/inventory/group_vars/all/all_services.yml ./dns/services.json: ./inventory/group_vars/all/all_services.yml
ansible-playbook \ ansible-playbook \
-e services_json_file=$(PWD)/dns/services.json \ -e services_json_file=$(PWD)/dns/services.json \
playbooks/create_services_for_dnscontrol.yml playbooks/create_services_for_dnscontrol.yml
output: ./dns/hosts.json ./dns/services.json ./playbooks/inventory/group_vars/all/opentofu.yml output: ./dns/hosts.json ./dns/services.json ./inventory/group_vars/all/opentofu.yml
./types-dnscontrol.d.ts: ./types-dnscontrol.d.ts:

2
ansible.cfg Normal file
View file

@ -0,0 +1,2 @@
[defaults]
inventory = ./inventory