Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,6 @@ loadbalancer

[caso:children]
monitoring

[letsencrypt:children]
loadbalancer
33 changes: 33 additions & 0 deletions dev/functions
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,39 @@ function tenks_deploy {
run_tenks_playbook "$tenks_path" deploy.yml "$tenks_deploy_type"
}

function tenks_reboot_network_fix {
set -eu
# Create a simple test Tenks deployment. Assumes that a bridge named
# 'breth1' exists. Arguments:
# $1: The path to the Tenks repo.
local tenks_path="$1"
local tenks_deploy_type="${2:-default}"

echo "Configuring missing Tenks host network"

environment_setup

# We don't want to use the Kayobe venv.
deactivate

# Install the Tenks venv.
install_venv_system_site_packages "${TENKS_VENV_PATH}" "$tenks_path" -c "$UPPER_CONSTRAINTS_FILE"
source ${TENKS_VENV_PATH:-$HOME/tenks-test-venv}/bin/activate

${KAYOBE_SOURCE_PATH}/tools/ansible-galaxy-retried.sh install \
--role-file="$tenks_path/requirements.yml" \
--roles-path="$tenks_path/ansible/roles/"

local parent="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Install a trivial script for ovs-vsctl that talks to containerised Open
# vSwitch.
sudo cp --no-clobber "$parent/ovs-vsctl" /usr/bin/ovs-vsctl

run_tenks_playbook "$tenks_path" host_setup.yml
run_tenks_playbook "$tenks_path" node_networking.yml "$tenks_deploy_type"
}

function tenks_teardown {
set -eu
# Tear down a test Tenks deployment.
Expand Down
26 changes: 26 additions & 0 deletions dev/tenks-network-reboot-patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -eu
set -o pipefail

# Simple script to configure and deploy a Tenks cluster. This should be
# executed from within the VM. Arguments:
# $1: The path to the Tenks repo.

PARENT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

source "${PARENT}/functions"


function main {
if [ -z ${1+x} ]; then
echo "Usage: $0 <tenks repo path>"
return 1
fi
tenks_path="$1"

config_init
tenks_reboot_network_fix "$tenks_path" overcloud
}

main "$@"