From d68db84a80a362c3bc06db3ce03096c58b332bda Mon Sep 17 00:00:00 2001 From: James Page Date: Tue, 20 Jan 2015 14:32:46 +0000 Subject: [PATCH 1/4] Updates for kilo --- hooks/quantum_utils.py | 19 +++++++++++-------- templates/kilo/fwaas_driver.ini | 7 +++++++ templates/kilo/lbaas_agent.ini | 8 ++++++++ templates/kilo/vpn_agent.ini | 8 ++++++++ unit_tests/test_quantum_utils.py | 5 +++++ 5 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 templates/kilo/fwaas_driver.ini create mode 100644 templates/kilo/lbaas_agent.ini create mode 100644 templates/kilo/vpn_agent.ini diff --git a/hooks/quantum_utils.py b/hooks/quantum_utils.py index 55a12807..8bedd589 100644 --- a/hooks/quantum_utils.py +++ b/hooks/quantum_utils.py @@ -163,14 +163,17 @@ def get_packages(): '''Return a list of packages for install based on the configured plugin''' plugin = remap_plugin(config('plugin')) packages = deepcopy(GATEWAY_PKGS[networking_name()][plugin]) - if (get_os_codename_install_source(config('openstack-origin')) - >= 'icehouse' and plugin == 'ovs' - and lsb_release()['DISTRIB_CODENAME'] < 'utopic'): - # NOTE(jamespage) neutron-vpn-agent supercedes l3-agent for icehouse - # but openswan was removed in utopic. - packages.remove('neutron-l3-agent') - packages.append('neutron-vpn-agent') - packages.append('openswan') + source = get_os_codename_install_source(config('openstack-origin')) + if plugin == 'ovs': + if (source >= 'icehouse' and + lsb_release()['DISTRIB_CODENAME'] < 'utopic'): + # NOTE(jamespage) neutron-vpn-agent supercedes l3-agent for icehouse + # but openswan was removed in utopic. + packages.remove('neutron-l3-agent') + packages.append('neutron-vpn-agent') + packages.append('openswan') + if source >= 'kilo': + packages.append('python-neutron-fwaas') return packages diff --git a/templates/kilo/fwaas_driver.ini b/templates/kilo/fwaas_driver.ini new file mode 100644 index 00000000..8ce9e542 --- /dev/null +++ b/templates/kilo/fwaas_driver.ini @@ -0,0 +1,7 @@ +############################################################################### +# [ WARNING ] +# Configuration file maintained by Juju. Local changes may be overwritten. +############################################################################### +[fwaas] +driver = neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver +enabled = True diff --git a/templates/kilo/lbaas_agent.ini b/templates/kilo/lbaas_agent.ini new file mode 100644 index 00000000..b37b7e1d --- /dev/null +++ b/templates/kilo/lbaas_agent.ini @@ -0,0 +1,8 @@ +[DEFAULT] +periodic_interval = 10 +interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver +ovs_use_veth = False +device_driver = neutron_lbaas.services.loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver +[haproxy] +loadbalancer_state_path = $state_path/lbaas +user_group = nogroup diff --git a/templates/kilo/vpn_agent.ini b/templates/kilo/vpn_agent.ini new file mode 100644 index 00000000..90874fd0 --- /dev/null +++ b/templates/kilo/vpn_agent.ini @@ -0,0 +1,8 @@ +############################################################################### +# [ WARNING ] +# Configuration file maintained by Juju. Local changes may be overwritten. +############################################################################### +[vpnagent] +vpn_device_driver=neutron_vpnaas.services.vpn.device_drivers.ipsec.OpenSwanDriver +[ipsec] +ipsec_status_check_interval=60 diff --git a/unit_tests/test_quantum_utils.py b/unit_tests/test_quantum_utils.py index 64c0c25e..17cb01fb 100644 --- a/unit_tests/test_quantum_utils.py +++ b/unit_tests/test_quantum_utils.py @@ -132,6 +132,11 @@ class TestQuantumUtils(CharmTestCase): self.assertTrue('neutron-vpn-agent' in quantum_utils.get_packages()) self.assertFalse('neutron-l3-agent' in quantum_utils.get_packages()) + def test_get_packages_ovs_kilo(self): + self.config.return_value = 'ovs' + self.get_os_codename_install_source.return_value = 'kilo' + self.assertTrue('python-neutron-fwaas' in quantum_utils.get_packages()) + def test_configure_ovs_starts_service_if_required(self): self.config.return_value = 'ovs' self.service_running.return_value = False From cbec4ef1336ee8f3e4995240962fbf76542dbd9f Mon Sep 17 00:00:00 2001 From: James Page Date: Wed, 21 Jan 2015 09:49:23 +0000 Subject: [PATCH 2/4] Fixup lint --- hooks/quantum_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/quantum_utils.py b/hooks/quantum_utils.py index 8bedd589..9173afb9 100644 --- a/hooks/quantum_utils.py +++ b/hooks/quantum_utils.py @@ -167,8 +167,8 @@ def get_packages(): if plugin == 'ovs': if (source >= 'icehouse' and lsb_release()['DISTRIB_CODENAME'] < 'utopic'): - # NOTE(jamespage) neutron-vpn-agent supercedes l3-agent for icehouse - # but openswan was removed in utopic. + # NOTE(jamespage) neutron-vpn-agent supercedes l3-agent for + # icehouse but openswan was removed in utopic. packages.remove('neutron-l3-agent') packages.append('neutron-vpn-agent') packages.append('openswan') From 00bd07b334523b585ba8982c145cc5ed95747e4a Mon Sep 17 00:00:00 2001 From: James Page Date: Wed, 21 Jan 2015 12:10:29 +0000 Subject: [PATCH 3/4] Add nova template for kilo --- templates/kilo/nova.conf | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 templates/kilo/nova.conf diff --git a/templates/kilo/nova.conf b/templates/kilo/nova.conf new file mode 100644 index 00000000..b186a473 --- /dev/null +++ b/templates/kilo/nova.conf @@ -0,0 +1,29 @@ +# kilo +############################################################################### +# [ WARNING ] +# Configuration file maintained by Juju. Local changes may be overwritten. +############################################################################### +[DEFAULT] +logdir=/var/log/nova +state_path=/var/lib/nova +lock_path=/var/lock/nova +root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf +verbose= {{ verbose }} +use_syslog = {{ use_syslog }} +api_paste_config=/etc/nova/api-paste.ini +enabled_apis=metadata +multi_host=True +{% include "parts/database" %} +neutron_metadata_proxy_shared_secret={{ shared_secret }} +service_neutron_metadata_proxy=True +# Access to message bus +{% include "parts/rabbitmq" %} +# Access to neutron API services +network_api_class=nova.network.neutronv2.api.API +[neutron] +auth_strategy=keystone +url={{ quantum_url }} +admin_tenant_name={{ service_tenant }} +admin_username={{ service_username }} +admin_password={{ service_password }} +admin_auth_url={{ service_protocol }}://{{ keystone_host }}:{{ service_port }}/v2.0 From 59e77f21f82af2822e72e4c63dd9cb1542ae37d8 Mon Sep 17 00:00:00 2001 From: James Page Date: Wed, 21 Jan 2015 12:15:01 +0000 Subject: [PATCH 4/4] Move options around a bit --- templates/kilo/nova.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/kilo/nova.conf b/templates/kilo/nova.conf index b186a473..47489f8b 100644 --- a/templates/kilo/nova.conf +++ b/templates/kilo/nova.conf @@ -14,8 +14,6 @@ api_paste_config=/etc/nova/api-paste.ini enabled_apis=metadata multi_host=True {% include "parts/database" %} -neutron_metadata_proxy_shared_secret={{ shared_secret }} -service_neutron_metadata_proxy=True # Access to message bus {% include "parts/rabbitmq" %} # Access to neutron API services @@ -27,3 +25,5 @@ admin_tenant_name={{ service_tenant }} admin_username={{ service_username }} admin_password={{ service_password }} admin_auth_url={{ service_protocol }}://{{ keystone_host }}:{{ service_port }}/v2.0 +service_metadata_proxy=True +metadata_proxy_shared_secret={{ shared_secret }}