From 0c60e974a2e854191ec4a3a5b44ac1236e50e103 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Fri, 18 Oct 2024 01:34:55 +0200 Subject: [PATCH] Move inventory back into root directory --- .gitignore | 6 +++--- Makefile | 12 ++++++------ ansible.cfg | 2 ++ .../group_vars/all/compose_defaults.yml | 0 .../inventory => inventory}/group_vars/all/main.yml | 0 {playbooks/inventory => inventory}/serguzim.net.yml | 0 6 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 ansible.cfg rename {playbooks/inventory => inventory}/group_vars/all/compose_defaults.yml (100%) rename {playbooks/inventory => inventory}/group_vars/all/main.yml (100%) rename {playbooks/inventory => inventory}/serguzim.net.yml (100%) 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