Change roles to get domain from all_services
This commit is contained in:
parent
6ace704a46
commit
bd6409bcc0
25 changed files with 37 additions and 24 deletions
|
@ -4,6 +4,7 @@ class FilterModule(object):
|
|||
'my_service_attributes': self.my_service_attributes,
|
||||
'services_to_dnscontrol': self.services_to_dnscontrol,
|
||||
'services_get_backups': self.services_get_backups,
|
||||
'service_get_domain': self.service_get_domain,
|
||||
}
|
||||
|
||||
def my_service_attributes(self, services, host, attribute="name"):
|
||||
|
@ -24,6 +25,12 @@ class FilterModule(object):
|
|||
|
||||
return result
|
||||
|
||||
def find_service(self, services, name):
|
||||
for service in services:
|
||||
if service.get("name") == name:
|
||||
return service
|
||||
return None
|
||||
|
||||
def services_get_backups(self, all_services, wanted_services):
|
||||
result = []
|
||||
for service in all_services:
|
||||
|
@ -32,6 +39,12 @@ class FilterModule(object):
|
|||
result.append(backup["name"])
|
||||
return result
|
||||
|
||||
def service_get_domain(self, all_services, wanted_service):
|
||||
if service := self.find_service(all_services, wanted_service):
|
||||
if dns := service.get("dns"):
|
||||
if dns_0 := dns[0]:
|
||||
return dns_0.get("domain")
|
||||
return None
|
||||
|
||||
def services_to_dnscontrol(self, services):
|
||||
result = {}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
NAME_svc:
|
||||
domain: NAME.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 80
|
||||
|
||||
NAME_env:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
acme_dns_svc:
|
||||
domain: "{{ acme_dns.host }}"
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 80
|
||||
nsadmin: "{{ admin_email | regex_replace('@', '.') }}"
|
||||
records:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
authentik_svc:
|
||||
domain: auth.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 9000
|
||||
image_tag: 2024.8
|
||||
db:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
faas_svc:
|
||||
domain: faas.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
docker_host: host.docker.internal
|
||||
port: 8080
|
||||
extra_svcs:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
forgejo_svc:
|
||||
domain: git.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 3000
|
||||
caddy_extra: |
|
||||
import analytics
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
gatus_svc:
|
||||
domain: status.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 8080
|
||||
|
||||
gatus_external_endpoints_backups: "{{ vault_hosts | vault_hosts_backup_to_gatus() }}"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
homebox_svc:
|
||||
domain: inventory.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 7745
|
||||
|
||||
homebox_env:
|
||||
|
|
|
@ -5,7 +5,7 @@ immich_db_user: "{{ vault_immich.db.user }}"
|
|||
immich_db_pass: "{{ vault_immich.db.pass }}"
|
||||
|
||||
immich_svc:
|
||||
domain: gallery.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 2283
|
||||
version: release
|
||||
db:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
influxdb_svc:
|
||||
domain: tick.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 8086
|
||||
data_dir: /var/lib/influxdb2
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
jellyfin_svc:
|
||||
domain: media.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 8096
|
||||
db:
|
||||
host: "{{ postgres.host }}"
|
||||
|
|
|
@ -10,7 +10,7 @@ linkwarden_s3_accesskey: "{{ opentofu.scaleway_data.linkwarden.access_key }}"
|
|||
linkwarden_s3_secretkey: "{{ opentofu.scaleway_data.linkwarden.secret_key }}"
|
||||
|
||||
linkwarden_svc:
|
||||
domain: bookmarks.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 3000
|
||||
|
||||
linkwarden_env:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
mailcowdockerized_svc:
|
||||
domain: mail.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
docker_host: host.docker.internal
|
||||
port: 3004
|
||||
additional_domains: "{{ ['autodiscover', 'autoconfig'] | product(vault_mailcowdockerized.domains) | map('join', '.') }}"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
minio_svc:
|
||||
domain: s3.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 9000
|
||||
caddy_extra: |
|
||||
@nocache {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
ntfy_svc:
|
||||
domain: push.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 80
|
||||
|
||||
ntfy_env:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
reitanlage_oranienburg_svc:
|
||||
domain: reitanlage-oranienburg.de
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
www_domain: true
|
||||
port: 80
|
||||
caddy_extra: |
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
shlink_svc:
|
||||
domain: msrg.cc
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
additional_domains:
|
||||
- "emgauwa.app"
|
||||
port: 8080
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
synapse_svc:
|
||||
domain: matrix.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
docker_host: synapse-admin
|
||||
port: 80
|
||||
caddy_extra: |
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
tandoor_svc:
|
||||
domain: recipes.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 80
|
||||
db:
|
||||
host: "{{ postgres.host }}"
|
||||
|
|
|
@ -8,7 +8,7 @@ teamspeak_fallback_user: 9987
|
|||
teamspeak_fallback_group: 9987
|
||||
|
||||
teamspeak_fallback_svc:
|
||||
domain: ts.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
additional_domains:
|
||||
- hook.serguzim.me
|
||||
port: 9000
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
tinytinyrss_svc:
|
||||
domain: rss.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 80
|
||||
db:
|
||||
host: "{{ postgres.host }}"
|
||||
|
|
|
@ -9,7 +9,7 @@ umami_hash_salt: "{{ vault_umami.hash_salt }}"
|
|||
umami_docker_image: docker.umami.dev/umami-software/umami:postgresql-latest
|
||||
|
||||
umami_svc:
|
||||
domain: analytics.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 3000
|
||||
|
||||
umami_env:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
vikunja_svc:
|
||||
domain: todo.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 3456
|
||||
db:
|
||||
host: "{{ postgres.host }}"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
wiki_js_svc:
|
||||
domain: wiki.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 3000
|
||||
caddy_extra: |
|
||||
import analytics
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
woodpecker_svc:
|
||||
domain: ci.serguzim.me
|
||||
domain: "{{ all_services | service_get_domain(role_name) }}"
|
||||
port: 8000
|
||||
extra_svcs:
|
||||
- domain: agents.ci.serguzim.me
|
||||
|
|
Loading…
Reference in a new issue