From a7c8d88dbbd8e52bea4b66340c3e61b79a75e50f Mon Sep 17 00:00:00 2001 From: Ante Karamatic Date: Sat, 1 Mar 2014 18:39:21 +0100 Subject: [PATCH 1/4] Fix unison: https://code.launchpad.net/~ivoks/charm-helpers/fix-unison/+merge/208937 --- hooks/charmhelpers/contrib/unison/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/charmhelpers/contrib/unison/__init__.py b/hooks/charmhelpers/contrib/unison/__init__.py index c9cd0b10..06956085 100644 --- a/hooks/charmhelpers/contrib/unison/__init__.py +++ b/hooks/charmhelpers/contrib/unison/__init__.py @@ -253,5 +253,5 @@ def sync_to_peer(host, user, paths=[], verbose=False): def sync_to_peers(peer_interface, user, paths=[], verbose=False): '''Sync all hosts to an specific path''' - for host in collect_authed_hosts(): + for host in collect_authed_hosts(peer_interface): sync_to_peer(host, user, paths, verbose) From 38bfc0e54ffdf92588db30ac626e06de3b2fe50d Mon Sep 17 00:00:00 2001 From: Ante Karamatic Date: Sat, 1 Mar 2014 19:09:28 +0100 Subject: [PATCH 2/4] Use tcp instead of http for LB --- templates/haproxy.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/haproxy.cfg b/templates/haproxy.cfg index fccf1c9d..548766f8 100644 --- a/templates/haproxy.cfg +++ b/templates/haproxy.cfg @@ -8,8 +8,8 @@ global defaults log global - mode http - option httplog + mode tcp + option tcplog option dontlognull retries 3 timeout queue 1000 @@ -19,6 +19,7 @@ defaults listen stats :8888 mode http + option httplog stats enable stats hide-version stats realm Haproxy\ Statistics @@ -29,7 +30,6 @@ listen stats :8888 {% for service, ports in service_ports.iteritems() -%} listen {{ service }} 0.0.0.0:{{ ports[0] }} balance roundrobin - option tcplog {% for unit, address in units.iteritems() -%} server {{ unit }} {{ address }}:{{ ports[1] }} check {% endfor %} From 5772e674674c273a939e618012875be82408f3b3 Mon Sep 17 00:00:00 2001 From: Ante Karamatic Date: Sun, 2 Mar 2014 09:56:04 +0100 Subject: [PATCH 3/4] Use VIP for Apache on ha-changed relation --- hooks/charmhelpers/contrib/openstack/context.py | 3 +++ hooks/keystone_hooks.py | 1 + revision | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hooks/charmhelpers/contrib/openstack/context.py b/hooks/charmhelpers/contrib/openstack/context.py index 11ddc0b0..b0233445 100644 --- a/hooks/charmhelpers/contrib/openstack/context.py +++ b/hooks/charmhelpers/contrib/openstack/context.py @@ -432,6 +432,9 @@ class ApacheSSLContext(OSContextGenerator): 'private_address': unit_get('private-address'), 'endpoints': [] } + vip = config('vip') + if is_clustered() and vip: + ctxt['private_address'] = vip for api_port in self.external_ports: ext_port = determine_apache_port(api_port) int_port = determine_api_port(api_port) diff --git a/hooks/keystone_hooks.py b/hooks/keystone_hooks.py index 074b1896..f84010c0 100755 --- a/hooks/keystone_hooks.py +++ b/hooks/keystone_hooks.py @@ -186,6 +186,7 @@ def ha_changed(): if (clustered is not None and is_leader(CLUSTER_RES)): ensure_initial_admin(config) + CONFIGS.write_all() log('Cluster configured, notifying other services and updating ' 'keystone endpoint configuration') for rid in relation_ids('identity-service'): diff --git a/revision b/revision index dcb6b5ba..71d936fd 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -230 +231 From 09ddcbc3135099f266735649b1e7f2a8280dc356 Mon Sep 17 00:00:00 2001 From: Ante Karamatic Date: Sun, 2 Mar 2014 10:16:17 +0100 Subject: [PATCH 4/4] Redux --- hooks/charmhelpers/contrib/openstack/context.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hooks/charmhelpers/contrib/openstack/context.py b/hooks/charmhelpers/contrib/openstack/context.py index b0233445..249e896c 100644 --- a/hooks/charmhelpers/contrib/openstack/context.py +++ b/hooks/charmhelpers/contrib/openstack/context.py @@ -432,9 +432,8 @@ class ApacheSSLContext(OSContextGenerator): 'private_address': unit_get('private-address'), 'endpoints': [] } - vip = config('vip') - if is_clustered() and vip: - ctxt['private_address'] = vip + if is_clustered(): + ctxt['private_address'] = config('vip') for api_port in self.external_ports: ext_port = determine_apache_port(api_port) int_port = determine_api_port(api_port)