Fix hosts

This commit is contained in:
Sam A. 2023-11-05 20:54:47 +01:00
parent 73d8706461
commit 374f3ec169
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
4 changed files with 7 additions and 5 deletions

View file

@ -2,4 +2,4 @@
# code: language=ansible # code: language=ansible
--- ---
db_inventory_hostname: sapt-labp-db01 db_inventory_hostname: sapt-labp-db01
db_host_ip: "{{ hostvars[db_inventory_hostname].ansible_default_ipv4.address }}" db_host: "{{ hostvars[db_inventory_hostname].ansible_host }}"

View file

@ -2,4 +2,4 @@
# code: language=ansible # code: language=ansible
--- ---
db_inventory_hostname: sapt-labs-db01 db_inventory_hostname: sapt-labs-db01
db_host_ip: "{{ hostvars[db_inventory_hostname].ansible_default_ipv4.address }}" db_host: "{{ hostvars[db_inventory_hostname].ansible_host }}"

View file

@ -13,7 +13,7 @@ services:
image: nextcloud:{{ apps_vars.nextcloud.version }} image: nextcloud:{{ apps_vars.nextcloud.version }}
restart: always restart: always
environment: environment:
POSTGRES_HOST: "{{ db_host_ip }}" POSTGRES_HOST: "{{ db_host }}"
POSTGRES_DB: nextcloud POSTGRES_DB: nextcloud
POSTGRES_USER: nextcloud POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: {{ db_passwords.nextcloud }} POSTGRES_PASSWORD: {{ db_passwords.nextcloud }}
@ -56,4 +56,4 @@ networks:
{{ apps_postfix_docker_network }}: {{ apps_postfix_docker_network }}:
external: true external: true
{{ apps_shared_docker_network }}: {{ apps_shared_docker_network }}:
external: true external: true

View file

@ -11,6 +11,8 @@ ff02::2 ip6-allrouters
ff02::3 ip6-allhosts ff02::3 ip6-allhosts
# Static hostnames for VMs # Static hostnames for VMs
{% for host in groups[all] %} {% for host in groups['all'] %}
{% if 'ansible_eth1' in hostvars[host] %}
{{ hostvars[host].ansible_eth1.ipv4.address }} {{ hostvars[host].ansible_host }} {{ hostvars[host].ansible_eth1.ipv4.address }} {{ hostvars[host].ansible_host }}
{% endif %}
{% endfor %} {% endfor %}