diff options
Diffstat (limited to 'mcp')
6 files changed, 39 insertions, 9 deletions
diff --git a/mcp/patches/0008-Handle-extra-environment-variables.patch b/mcp/patches/0008-Handle-extra-environment-variables.patch new file mode 100644 index 000000000..8df3227f2 --- /dev/null +++ b/mcp/patches/0008-Handle-extra-environment-variables.patch @@ -0,0 +1,25 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: Copyright (c) 2018 Mirantis Inc., Enea AB and others. +: +: All rights reserved. This program and the accompanying materials +: are made available under the terms of the Apache License, Version 2.0 +: which accompanies this distribution, and is available at +: http://www.apache.org/licenses/LICENSE-2.0 +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +From: Michael Polenchuk <mpolenchuk@mirantis.com> +Date: Mon, 12 Mar 2018 17:43:09 +0400 +Subject: [PATCH] Handle extra environment variables + +Change-Id: Ieae46ac65041630759c82238a8a5ce0535c454b2 + +diff --git a/keystone/files/keystonercv3 b/keystone/files/keystonercv3 +index 1b7f378..984c8a2 100644 +--- a/keystone/files/keystonercv3 ++++ b/keystone/files/keystonercv3 +@@ -11,3 +11,6 @@ export OS_REGION_NAME={{ server.region }} + export OS_INTERFACE=internal + export OS_ENDPOINT_TYPE="internal" + export OS_CACERT="{{ server.cacert }}" ++{%- for opt, value in server.get('openrc_extra', {}).iteritems() %} ++{{ "export %s=%s"|format(opt|upper, value) }} ++{%- endfor %} diff --git a/mcp/patches/0015-Set-ovs-bridges-as-L3-interfaces.patch b/mcp/patches/0015-Set-ovs-bridges-as-L3-interfaces.patch index 55cf093f4..e2396de2b 100644 --- a/mcp/patches/0015-Set-ovs-bridges-as-L3-interfaces.patch +++ b/mcp/patches/0015-Set-ovs-bridges-as-L3-interfaces.patch @@ -14,18 +14,16 @@ Change-Id: I1e83129cc184cf481bea21d7aa452bf60d9e0499 diff --git a/linux/files/ovs_bridge b/linux/files/ovs_bridge new file mode 100644 -index 0000000..8c0f468 +index 0000000..575d38f --- /dev/null +++ b/linux/files/ovs_bridge -@@ -0,0 +1,14 @@ +@@ -0,0 +1,12 @@ +auto {{ bridge_name }} +allow-ovs {{ bridge_name }} -+iface {{ bridge_name }} inet {{ bridge.get('proto', 'manual') }} ++iface {{ bridge_name }} inet static + ovs_type OVSBridge -+ {%- if bridge.get('proto', 'manual') == 'static' %} + address {{ bridge.address }} + netmask {{ bridge.netmask }} -+ {%- endif %} + {%- if bridge.gateway is defined %} + gateway {{ bridge.gateway }} + {%- endif %} @@ -47,13 +45,14 @@ index 222ca8e..efb0307 100644 mtu {{ port.get('mtu', '1500') }} ovs_bridge {{ port.bridge }} diff --git a/linux/network/interface.sls b/linux/network/interface.sls -index 7375b04..bbf2fa0 100644 +index 3e79847..dc7180a 100644 --- a/linux/network/interface.sls +++ b/linux/network/interface.sls -@@ -67,6 +67,32 @@ remove_cloud_init_file: +@@ -72,6 +72,34 @@ remove_cloud_init_file: ovs_bridge_{{ interface_name }}: openvswitch_bridge.present: - name: {{ interface_name }} ++{%- if interface.get('proto', 'manual') == 'static' %} + file.managed: + - name: /etc/network/interfaces.u/ifcfg-{{ interface_name }} + - makedirs: True @@ -80,6 +79,7 @@ index 7375b04..bbf2fa0 100644 + - file: linux_interfaces_final_include + - unless: + - ip link show {{ interface_name }} | grep -q '\<UP\>' ++{%- endif %} {# add linux network interface into OVS bridge #} {%- for int_name, int in network.interface.items() %} diff --git a/mcp/patches/patches.list b/mcp/patches/patches.list index 9d46005bf..9c460f8e8 100644 --- a/mcp/patches/patches.list +++ b/mcp/patches/patches.list @@ -12,6 +12,7 @@ /usr/share/salt-formulas/env: 0005-maas-module-Obtain-fabric-ID-from-CIDR.patch /usr/share/salt-formulas/env: 0006-maas-module-Add-VLAN-DHCP-enable-support.patch /usr/share/salt-formulas/env: 0007-network.interface-Fix-ifup-OVS-port-with-route.patch +/usr/share/salt-formulas/env: 0008-Handle-extra-environment-variables.patch /usr/share/salt-formulas/env: 0009-controller-Use-keystoneclient-to-check-project-ID.patch /usr/share/salt-formulas/env: 0010-maas-region-allow-timeout-override.patch /usr/share/salt-formulas/env: 0011-system.repo-Debian-Add-keyserver-proxy-support.patch diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/openstack_control.yml.j2 b/mcp/reclass/classes/cluster/mcp-pike-common-ha/openstack_control.yml.j2 index c487e3424..6f7b33e3d 100644 --- a/mcp/reclass/classes/cluster/mcp-pike-common-ha/openstack_control.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-pike-common-ha/openstack_control.yml.j2 @@ -138,6 +138,8 @@ parameters: keystone: server: cacert: /etc/ssl/certs/mcp_os_cacert + openrc_extra: + volume_device_name: vdc bind: server: control: diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-noha/openstack_control.yml b/mcp/reclass/classes/cluster/mcp-pike-common-noha/openstack_control.yml index 5c0cbe07f..01b320973 100644 --- a/mcp/reclass/classes/cluster/mcp-pike-common-noha/openstack_control.yml +++ b/mcp/reclass/classes/cluster/mcp-pike-common-noha/openstack_control.yml @@ -56,6 +56,8 @@ parameters: keystone: server: admin_email: ${_param:admin_email} + openrc_extra: + volume_device_name: vdc glance: server: storage: diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh index 5be4c556d..7d57fcf5f 100644 --- a/mcp/scripts/lib.sh +++ b/mcp/scripts/lib.sh @@ -120,7 +120,7 @@ function mount_image { break fi done - OPNFV_LOOP_DEV=$(losetup -f) + OPNFV_LOOP_DEV=$(sudo losetup -f) OPNFV_MAP_DEV=/dev/mapper/$(basename "${OPNFV_NBD_DEV}")p1 export OPNFV_MNT_DIR OPNFV_LOOP_DEV [ -n "${OPNFV_NBD_DEV}" ] && [ -n "${OPNFV_LOOP_DEV}" ] || exit 1 @@ -213,7 +213,7 @@ function cleanup_mounts { fi fi if [ -n "${OPNFV_LOOP_DEV}" ] && \ - losetup "${OPNFV_LOOP_DEV}" 1>&2 > /dev/null; then + sudo losetup "${OPNFV_LOOP_DEV}" 1>&2 > /dev/null; then sudo losetup -d "${OPNFV_LOOP_DEV}" fi if [ -n "${OPNFV_NBD_DEV}" ]; then |