2 ##############################################################################
3 # Copyright (c) 2018 Mirantis Inc., Enea AB and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
10 CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
12 # shellcheck disable=SC1090
13 source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh"
14 source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/xdf_data.sh"
16 cluster_nodes_query="${control_nodes_query} or cmp*"
18 # KVM, compute node prereqs
19 # patch the networking module for Debian based distros
20 debian_ip_source=/usr/lib/python2.7/dist-packages/salt/modules/debian_ip.py
21 salt -C "${cluster_nodes_query}" file.line $debian_ip_source \
22 content='iface = iface.lower()' mode='delete'
24 salt -C "${cluster_nodes_query}" file.replace $debian_ip_source \
25 pattern="^\s{8}__salt__\['pkg.install'\]\('vlan'\)" \
26 repl="\n if not __salt__['pkg.version']('vlan'):\n __salt__['pkg.install']('vlan')"
28 salt -C "${cluster_nodes_query}" pkg.install bridge-utils
29 salt -C "${cluster_nodes_query}" state.apply linux.system.repo
30 wait_for 5.0 "salt -C '${cluster_nodes_query}' state.apply salt.minion"
31 wait_for 5.0 "salt -C '${cluster_nodes_query}' state.apply linux,ntp"
32 wait_for 30.0 "salt -C '${cluster_nodes_query}' test.ping"
34 salt -C "${cluster_nodes_query}" cmd.run 'reboot'
35 wait_for 90.0 "salt -C '${cluster_nodes_query}' test.ping"
37 salt -C "${cluster_nodes_query}" state.apply linux,ntp
38 salt -C "${cluster_nodes_query}" pkg.upgrade refresh=False dist_upgrade=True