Move all_services into opentofu

This commit is contained in:
Tobias Reisinger 2024-10-06 19:08:13 +02:00
parent 6fdfd338a1
commit 2ad3cce749
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
10 changed files with 415 additions and 267 deletions

View file

@ -7,6 +7,16 @@ PWD := $(shell pwd)
.FORCE:
./inventory/group_vars/all/all_services.yml: .FORCE
tofu output --json \
| yq -y '{all_services: with_entries(.value |= .value).services | to_entries | map(.value)}' \
> ./inventory/group_vars/all/all_services.yml
./inventory/group_vars/all/opentofu.yml: .FORCE
tofu output --json \
| yq -y '{opentofu: with_entries(.value |= .value)}' \
> ./inventory/group_vars/all/opentofu.yml
./dns/hosts.json: .FORCE
tofu output --json \
| jq 'with_entries(.value |= .value).hosts' \
@ -17,12 +27,8 @@ PWD := $(shell pwd)
-e services_json_file=$(PWD)/dns/services.json \
playbooks/create_services_for_dnscontrol.yml
./inventory/group_vars/all/opentofu.yaml: .FORCE
tofu output --json \
| yq -y '{opentofu: with_entries(.value |= .value)}' \
> ./inventory/group_vars/all/opentofu.yaml
output: ./dns/hosts.json ./dns/services.json ./inventory/group_vars/all/opentofu.yaml
output: ./dns/hosts.json ./dns/services.json ./inventory/group_vars/all/opentofu.yml
./types-dnscontrol.d.ts:
@ -30,7 +36,7 @@ output: ./dns/hosts.json ./dns/services.json ./inventory/group_vars/all/opentofu
tofu:
tofu apply
echo "\n=====\n"
@printf "\n=====\n\n"
$(MAKE) output
dns: ./types-dnscontrol.d.ts ./dns/hosts.json ./dns/services.json