diff --git a/.gitignore b/.gitignore index b9aa3ac..ebf0b61 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,8 @@ dns/services.json secrets.auto.tfvars .terraform -playbooks/inventory/group_vars/all/serguzim.net.yml -playbooks/inventory/group_vars/all/opentofu.yml -playbooks/inventory/group_vars/all/all_services.yml +inventory/group_vars/all/serguzim.net.yml +inventory/group_vars/all/opentofu.yml +inventory/group_vars/all/all_services.yml infrastructure.svg diff --git a/Makefile b/Makefile index fe905b3..fd5d543 100644 --- a/Makefile +++ b/Makefile @@ -9,28 +9,28 @@ PWD := $(shell pwd) .FORCE: -./playbooks/inventory/group_vars/all/all_services.yml: .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)}' \ - > ./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 \ | yq -y '{opentofu: with_entries(.value |= .value)}' \ - > ./playbooks/inventory/group_vars/all/opentofu.yml + > ./inventory/group_vars/all/opentofu.yml ./dns/hosts.json: .FORCE tofu output --json \ | jq 'with_entries(.value |= .value).hosts' \ > ./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 \ -e services_json_file=$(PWD)/dns/services.json \ 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: diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..73ee9b1 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,2 @@ +[defaults] +inventory = ./inventory diff --git a/playbooks/inventory/group_vars/all/compose_defaults.yml b/inventory/group_vars/all/compose_defaults.yml similarity index 100% rename from playbooks/inventory/group_vars/all/compose_defaults.yml rename to inventory/group_vars/all/compose_defaults.yml diff --git a/playbooks/inventory/group_vars/all/main.yml b/inventory/group_vars/all/main.yml similarity index 100% rename from playbooks/inventory/group_vars/all/main.yml rename to inventory/group_vars/all/main.yml diff --git a/playbooks/inventory/serguzim.net.yml b/inventory/serguzim.net.yml similarity index 100% rename from playbooks/inventory/serguzim.net.yml rename to inventory/serguzim.net.yml