From 26263acb5690249f5165babbb381f512327961b7 Mon Sep 17 00:00:00 2001 From: Edward Hope-Morley Date: Mon, 26 Jan 2015 14:59:24 +0000 Subject: [PATCH 1/2] fix ipv6 db access --- hooks/quantum_hooks.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hooks/quantum_hooks.py b/hooks/quantum_hooks.py index e8b74861..89dee94e 100755 --- a/hooks/quantum_hooks.py +++ b/hooks/quantum_hooks.py @@ -32,6 +32,7 @@ from charmhelpers.contrib.hahelpers.apache import( from charmhelpers.contrib.openstack.utils import ( configure_installation_source, openstack_upgrade_available, + sync_db_with_multi_ipv6_addresses, ) from charmhelpers.payload.execd import execd_preinstall from charmhelpers.core.sysctl import create as create_sysctl @@ -138,10 +139,15 @@ def db_joined(relation_id=None): 'associated a postgresql one') log(e, level=ERROR) raise Exception(e) - relation_set(username=config('database-user'), - database=config('database'), - hostname=unit_get('private-address'), - relation_id=relation_id) + + if config('prefer-ipv6'): + sync_db_with_multi_ipv6_addresses(config('database'), + config('database-user')) + else: + relation_set(username=config('database-user'), + database=config('database'), + hostname=unit_get('private-address'), + relation_id=relation_id) @hooks.hook('pgsql-db-relation-joined') From a3a0b6a4cc73c6ba63f3bb39db5944f5ee6cc309 Mon Sep 17 00:00:00 2001 From: Edward Hope-Morley Date: Mon, 26 Jan 2015 15:29:46 +0000 Subject: [PATCH 2/2] added missing prefer-ipv6 config option --- config.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config.yaml b/config.yaml index fdcab2bd..1df4b05f 100644 --- a/config.yaml +++ b/config.yaml @@ -114,6 +114,18 @@ options: juju-myservice-0 If you're running multiple environments with the same services in them this allows you to differentiate between them. + prefer-ipv6: + type: boolean + default: False + description: | + If True enables IPv6 support. The charm will expect network interfaces + to be configured with an IPv6 address. If set to False (default) IPv4 + is expected. + . + NOTE: these charms do not currently support IPv6 privacy extension. In + order for this charm to function correctly, the privacy extension must be + disabled and a non-temporary address must be configured/available on + your network interface. # Network configuration options # by default all access is over 'private-address' os-data-network: