ara_api role: properly default to ipv6 when no ipv4

ansible_default_ipv4 is understandably empty when in a pure ipv6
environment. In that case default to ansible_default_ipv6 instead.

Change-Id: Ie7a2918b003d1fb260eb555abb43c5233d474819
This commit is contained in:
David Moreau Simard 2020-01-24 19:08:15 -05:00
parent 3399418daf
commit 02e2f2febd
No known key found for this signature in database
GPG Key ID: 938880DAFC753E80
1 changed files with 3 additions and 3 deletions

View File

@ -83,8 +83,8 @@ ara_api_wsgi_server: null
# "ara_api_cors_origin_whitelist".
ara_api_wsgi_bind: "127.0.0.1:8000"
# When using a frontend server, the domain it will be listening on
ara_api_fqdn: "{{ ansible_default_ipv4['address'] }}"
# When using a frontend server, the domain or address it will be listening on
ara_api_fqdn: "{{ ansible_default_ipv4['address'] | default(ansible_default_ipv6['address']) }}"
####################################
# ara API configuration settings
@ -155,7 +155,7 @@ ara_api_allowed_hosts:
- "127.0.0.1"
- "localhost"
- "::1"
- "{{ ansible_default_ipv4['address'] }}"
- "{{ ara_api_fqdn }}"
# ARA_DEBUG - Django's DEBUG setting
# It is not recommended to run with debug enabled in production.