summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Polenchuk <mpolenchuk@mirantis.com>2017-11-09 12:11:06 +0400
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-11-09 15:34:42 +0000
commit0f9d744587a3ebf37b9f84a7ef73d9433961d317 (patch)
treef2c7696b734ab1fc599d156b9960370468ceaf5f
parente708686d0d6727feca64609ed5ff8e2328c0b5f5 (diff)
Handle vlan package to avoid downgrade
Change-Id: Ic81507f3f7b3fec593b507e0c534434e8489b01b Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com> (cherry picked from commit ceedb354822eb672fdde6d63d49cbe2f05f29cdb)
-rwxr-xr-xmcp/config/states/virtual_control_plane11
1 files changed, 9 insertions, 2 deletions
diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane
index d02ea4398..43d152023 100755
--- a/mcp/config/states/virtual_control_plane
+++ b/mcp/config/states/virtual_control_plane
@@ -14,9 +14,16 @@ source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh"
# KVM, compute node prereqs (libvirt first), VCP deployment
salt -C 'kvm* or cmp*' cmd.run 'rm -f /etc/network/interfaces.d/*.cfg'
-salt -C 'kvm* or cmp*' file.line \
- /usr/lib/python2.7/dist-packages/salt/modules/debian_ip.py \
+
+# patch the networking module for Debian based distros
+debian_ip_source=/usr/lib/python2.7/dist-packages/salt/modules/debian_ip.py
+salt -C 'kvm* or cmp*' file.line $debian_ip_source \
content='iface = iface.lower()' mode='delete'
+
+salt -C 'kvm* or cmp*' file.replace $debian_ip_source \
+ pattern="^\s{8}__salt__\['pkg.install'\]\('vlan'\)" \
+ repl="\n if not __salt__['pkg.version']('vlan'):\n __salt__['pkg.install']('vlan')"
+
salt -C 'kvm*' pkg.install bridge-utils
salt -C 'kvm*' state.apply linux.network
salt -C 'cmp*' state.apply linux.system