Move inventory back into root directory
This commit is contained in:
parent
b5ddefbd90
commit
0c60e974a2
6 changed files with 11 additions and 9 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -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
|
||||
|
|
|
|||
12
Makefile
12
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:
|
||||
|
|
|
|||
2
ansible.cfg
Normal file
2
ansible.cfg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[defaults]
|
||||
inventory = ./inventory
|
||||
37
inventory/group_vars/all/compose_defaults.yml
Normal file
37
inventory/group_vars/all/compose_defaults.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
compose_file_main:
|
||||
services:
|
||||
app:
|
||||
image: "{{ compose.image }}"
|
||||
restart: always
|
||||
labels:
|
||||
com.centurylinklabs.watchtower.enable: "{{ compose.watchtower | default(false) }}"
|
||||
|
||||
compose_file_env:
|
||||
services:
|
||||
app:
|
||||
env_file:
|
||||
- service.env
|
||||
|
||||
compose_file_networks:
|
||||
services:
|
||||
app:
|
||||
networks:
|
||||
default:
|
||||
apps:
|
||||
aliases:
|
||||
- "{{ role_name }}"
|
||||
networks:
|
||||
default:
|
||||
apps:
|
||||
external: true
|
||||
|
||||
compose_file_volumes:
|
||||
services:
|
||||
app:
|
||||
volumes: "{{ compose.volumes }}"
|
||||
|
||||
compose_file_monitoring_label:
|
||||
services:
|
||||
app:
|
||||
labels:
|
||||
com.influxdata.telegraf.enable: true
|
||||
31
inventory/group_vars/all/main.yml
Normal file
31
inventory/group_vars/all/main.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
admin_email: tobias@msrg.cc
|
||||
timezone: Europe/Berlin
|
||||
|
||||
postgres:
|
||||
host: "{{ opentofu.postgresql.host }}"
|
||||
port: "{{ opentofu.postgresql.port }}"
|
||||
|
||||
mailer:
|
||||
host: mail.serguzim.me
|
||||
port: 587
|
||||
|
||||
acme_dns:
|
||||
host: acme.serguzim.me
|
||||
|
||||
container_registry:
|
||||
public: "{{ opentofu.scaleway_registry_endpoint_public }}"
|
||||
private: "{{ opentofu.scaleway_registry_endpoint_private }}"
|
||||
|
||||
|
||||
services_path: /opt/services/
|
||||
|
||||
common_services:
|
||||
- backup
|
||||
- lego
|
||||
- caddy
|
||||
- watchtower
|
||||
|
||||
caddy_path: "{{ (services_path, 'caddy') | path_join }}"
|
||||
caddy_config_path: "{{ (caddy_path, 'config', 'conf.d') | path_join }}"
|
||||
|
||||
certificates_path: "{{ (services_path, '_certificates') | path_join }}"
|
||||
49
inventory/serguzim.net.yml
Normal file
49
inventory/serguzim.net.yml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
all:
|
||||
children:
|
||||
serguzim_net:
|
||||
hosts:
|
||||
node001:
|
||||
node002:
|
||||
node003:
|
||||
hosts:
|
||||
local-dev:
|
||||
ansible_connection: local
|
||||
|
||||
node001:
|
||||
ansible_host: "{{ opentofu.hosts.node001.fqdn_vpn }}"
|
||||
ansible_port: "{{ vault_hosts.node001.ansible_port }}"
|
||||
ansible_user: "{{ vault_hosts.node001.ansible_user }}"
|
||||
interactive_user: "{{ vault_hosts.node001.interactive_user }}"
|
||||
host_vpn:
|
||||
domain: "{{ opentofu.hosts.node001.fqdn_vpn }}"
|
||||
ip: "{{ opentofu.hosts.node001.ipv4_address_vpn }}"
|
||||
host_backup:
|
||||
hc_uid: "{{ opentofu.healthchecksio.backup.node001.id }}"
|
||||
hc_url: "{{ opentofu.healthchecksio.backup.node001.ping_url }}"
|
||||
gatus_token: "{{ vault_hosts.node001.backup.gatus_token }}"
|
||||
|
||||
node002:
|
||||
ansible_host: "{{ opentofu.hosts.node002.fqdn_vpn }}"
|
||||
ansible_port: "{{ vault_hosts.node002.ansible_port }}"
|
||||
ansible_user: "{{ vault_hosts.node002.ansible_user }}"
|
||||
interactive_user: "{{ vault_hosts.node002.interactive_user }}"
|
||||
host_vpn:
|
||||
domain: "{{ opentofu.hosts.node002.fqdn_vpn }}"
|
||||
ip: "{{ opentofu.hosts.node002.ipv4_address_vpn }}"
|
||||
host_backup:
|
||||
hc_uid: "{{ opentofu.healthchecksio.backup.node002.id }}"
|
||||
hc_url: "{{ opentofu.healthchecksio.backup.node002.ping_url }}"
|
||||
gatus_token: "{{ vault_hosts.node002.backup.gatus_token }}"
|
||||
|
||||
node003:
|
||||
ansible_host: "{{ opentofu.hosts.node003.fqdn_vpn }}"
|
||||
ansible_port: "{{ vault_hosts.node003.ansible_port }}"
|
||||
ansible_user: "{{ vault_hosts.node003.ansible_user }}"
|
||||
interactive_user: "{{ vault_hosts.node003.interactive_user }}"
|
||||
host_vpn:
|
||||
domain: "{{ opentofu.hosts.node003.fqdn_vpn }}"
|
||||
ip: "{{ opentofu.hosts.node003.ipv4_address_vpn }}"
|
||||
host_backup:
|
||||
hc_uid: "{{ opentofu.healthchecksio.backup.node003.id }}"
|
||||
hc_url: "{{ opentofu.healthchecksio.backup.node003.ping_url }}"
|
||||
gatus_token: "{{ vault_hosts.node003.backup.gatus_token }}"
|
||||
Loading…
Reference in a new issue