Merge lp:~hopem/charms/precise/nova-cloud-controller/lp1273469 into lp:~openstack-charmers-archive/charms/precise/nova-cloud-controller/trunk

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 67
Proposed branch: lp:~hopem/charms/precise/nova-cloud-controller/lp1273469
Merge into: lp:~openstack-charmers-archive/charms/precise/nova-cloud-controller/trunk
Diff against target: 138 lines (+34/-4)
4 files modified
hooks/charmhelpers/contrib/openstack/context.py (+23/-2)
hooks/charmhelpers/contrib/openstack/templates/ceph.conf (+3/-0)
hooks/charmhelpers/contrib/storage/linux/ceph.py (+6/-2)
templates/folsom/nova.conf (+2/-0)
To merge this branch: bzr merge lp:~hopem/charms/precise/nova-cloud-controller/lp1273469
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+208379@code.launchpad.net

Description of the change

Quoting ivoks from merge/206634:

As part of changing OpenStack charm to provide better SSL experience, we need to put HAproxy in front of the Apache. Apache then does SSL termination on destination host, and HAproxy balances TCP traffic instead of HTTP. This allows us to keep all outside server traffic - crypted.

In addition, we stop and start services, instead of restarting. This avoids TCP port conflicts.

Depends on charm-helpers from: lp:~ivoks/charm-helpers/new-ssl

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
2--- hooks/charmhelpers/contrib/openstack/context.py 2014-02-19 11:02:03 +0000
3+++ hooks/charmhelpers/contrib/openstack/context.py 2014-02-26 14:17:33 +0000
4@@ -29,6 +29,7 @@
5 determine_apache_port,
6 determine_api_port,
7 https,
8+ is_clustered
9 )
10
11 from charmhelpers.contrib.hahelpers.apache import (
12@@ -240,10 +241,13 @@
13 '''This generates context for /etc/ceph/ceph.conf templates'''
14 if not relation_ids('ceph'):
15 return {}
16+
17 log('Generating template context for ceph')
18+
19 mon_hosts = []
20 auth = None
21 key = None
22+ use_syslog = str(config('use-syslog')).lower()
23 for rid in relation_ids('ceph'):
24 for unit in related_units(rid):
25 mon_hosts.append(relation_get('private-address', rid=rid,
26@@ -255,6 +259,7 @@
27 'mon_hosts': ' '.join(mon_hosts),
28 'auth': auth,
29 'key': key,
30+ 'use_syslog': use_syslog
31 }
32
33 if not os.path.isdir('/etc/ceph'):
34@@ -391,7 +396,7 @@
35 return ctxt
36
37
38-class NeutronContext(object):
39+class NeutronContext(OSContextGenerator):
40 interfaces = []
41
42 @property
43@@ -452,6 +457,22 @@
44
45 return nvp_ctxt
46
47+ def neutron_ctxt(self):
48+ if https():
49+ proto = 'https'
50+ else:
51+ proto = 'http'
52+ if is_clustered():
53+ host = config('vip')
54+ else:
55+ host = unit_get('private-address')
56+ url = '%s://%s:%s' % (proto, host, '9292')
57+ ctxt = {
58+ 'network_manager': self.network_manager,
59+ 'neutron_url': url,
60+ }
61+ return ctxt
62+
63 def __call__(self):
64 self._ensure_packages()
65
66@@ -461,7 +482,7 @@
67 if not self.plugin:
68 return {}
69
70- ctxt = {'network_manager': self.network_manager}
71+ ctxt = self.neutron_ctxt()
72
73 if self.plugin == 'ovs':
74 ctxt.update(self.ovs_ctxt())
75
76=== modified file 'hooks/charmhelpers/contrib/openstack/templates/ceph.conf'
77--- hooks/charmhelpers/contrib/openstack/templates/ceph.conf 2013-08-02 03:42:16 +0000
78+++ hooks/charmhelpers/contrib/openstack/templates/ceph.conf 2014-02-26 14:17:33 +0000
79@@ -9,3 +9,6 @@
80 keyring = /etc/ceph/$cluster.$name.keyring
81 mon host = {{ mon_hosts }}
82 {% endif -%}
83+log to syslog = {{ use_syslog }}
84+err to syslog = {{ use_syslog }}
85+clog to syslog = {{ use_syslog }}
86
87=== modified file 'hooks/charmhelpers/contrib/storage/linux/ceph.py'
88--- hooks/charmhelpers/contrib/storage/linux/ceph.py 2013-11-06 03:48:26 +0000
89+++ hooks/charmhelpers/contrib/storage/linux/ceph.py 2014-02-26 14:17:33 +0000
90@@ -49,6 +49,9 @@
91 auth supported = {auth}
92 keyring = {keyring}
93 mon host = {mon_hosts}
94+ log to syslog = {use_syslog}
95+ err to syslog = {use_syslog}
96+ clog to syslog = {use_syslog}
97 """
98
99
100@@ -194,7 +197,7 @@
101 return hosts
102
103
104-def configure(service, key, auth):
105+def configure(service, key, auth, use_syslog):
106 ''' Perform basic configuration of Ceph '''
107 create_keyring(service, key)
108 create_key_file(service, key)
109@@ -202,7 +205,8 @@
110 with open('/etc/ceph/ceph.conf', 'w') as ceph_conf:
111 ceph_conf.write(CEPH_CONF.format(auth=auth,
112 keyring=_keyring_path(service),
113- mon_hosts=",".join(map(str, hosts))))
114+ mon_hosts=",".join(map(str, hosts)),
115+ use_syslog=use_syslog))
116 modprobe('rbd')
117
118
119
120=== modified file 'templates/folsom/nova.conf'
121--- templates/folsom/nova.conf 2014-02-19 13:29:35 +0000
122+++ templates/folsom/nova.conf 2014-02-26 14:17:33 +0000
123@@ -73,6 +73,7 @@
124
125 {% if network_manager and network_manager == 'quantum' -%}
126 network_api_class = nova.network.quantumv2.api.API
127+quantum_url = {{ neutron_url }}
128 {% if auth_host -%}
129 quantum_auth_strategy = keystone
130 quantum_admin_tenant_name = {{ admin_tenant_name }}
131@@ -82,6 +83,7 @@
132 {% endif -%}
133 {% elif network_manager and network_manager == 'neutron' -%}
134 network_api_class = nova.network.neutronv2.api.API
135+neutron_url = {{ neutron_url }}
136 {% if auth_host -%}
137 neutron_auth_strategy = keystone
138 neutron_admin_tenant_name = {{ admin_tenant_name }}

Subscribers

People subscribed via source and target branches