diff --git a/dev/functions b/dev/functions index 5afaffc8749f0f69be6a1dab7353e18a406424b3..8ae87da684c53e89b78fc67db99784fbe5c4a298 100644 --- a/dev/functions +++ b/dev/functions @@ -274,7 +274,7 @@ function environment_setup { function run_kayobe { # Run a kayobe command, including extra arguments provided via # $KAYOBE_EXTRA_ARGS. - kayobe ${KAYOBE_EXTRA_ARGS} $* + kayobe ${KAYOBE_EXTRA_ARGS} "${@}" } function control_host_bootstrap { @@ -593,6 +593,25 @@ function overcloud_test_init { fi } +function overcloud_test_bounce_interface { + shift + LIMIT=$1 + INTERFACE=$2 + + environment_setup + + # Change current configuration so that a subsequent host configure will bounce the interfaces: + if is_dnf; then + # Rocky + run_kayobe overcloud host command run -b --command "rm -f /etc/NetworkManager/system-connections/$INTERFACE.nmconnection" --limit "$LIMIT" + else + # Ubuntu + run_kayobe overcloud host command run -b --command "rm -f /etc/systemd/network/50-kayobe-$INTERFACE.network" --limit "$LIMIT" + fi + # Trigger bounce + run_kayobe overcloud host configure -t network +} + function overcloud_test { set -eu diff --git a/dev/overcloud-test-bounce-interface.sh b/dev/overcloud-test-bounce-interface.sh new file mode 100755 index 0000000000000000000000000000000000000000..c797cdf415ae1745050ac11fadb6db97271e8f06 --- /dev/null +++ b/dev/overcloud-test-bounce-interface.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -eu +set -o pipefail + +# Bounces a given interface on hosts matching the supplied limit. +# Positional arguments: +# arg0: Ansible limit +# arg1: Interface to bounce + +PARENT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +source "${PARENT}/functions" + + +function main { + config_init + overcloud_test_bounce_interface controllers "${@}" +} + +main "${@:1}" diff --git a/playbooks/kayobe-overcloud-host-configure-base/run.yml b/playbooks/kayobe-overcloud-host-configure-base/run.yml index 38e41494c9690d4b096acdd6b1c5764b74a094f7..bca6bc7f47486928fb8a073f475b0a7b06051750 100644 --- a/playbooks/kayobe-overcloud-host-configure-base/run.yml +++ b/playbooks/kayobe-overcloud-host-configure-base/run.yml @@ -10,6 +10,11 @@ testinfra_venv: ~/testinfra-venv test_path: "{{ kayobe_src_dir }}/playbooks/kayobe-overcloud-host-configure-base/tests/" tasks: + - name: Prevent NetworkManager from managing default interface + command: 'nmcli dev set {{ ansible_facts.default_ipv4.interface }} managed no' + become: true + when: ansible_facts.os_family == 'RedHat' + - name: Ensure overcloud is deployed shell: cmd: "{{ kayobe_src_dir }}/dev/overcloud-deploy.sh &> {{ logs_dir }}/ansible/overcloud-deploy" @@ -29,3 +34,8 @@ command: "{{ testinfra_venv }}/bin/py.test {{ test_path }} --html={{ logs_dir }}/test-results.html --self-contained-html" environment: SITE_MIRROR_FQDN: "{{ zuul_site_mirror_fqdn }}" + + - name: Test bouncing interfaces + shell: + cmd: "{{ kayobe_src_dir }}/dev/overcloud-test-bounce-interface.sh controllers br1 &> {{ logs_dir }}/ansible/overcloud-test-bounce-interface" + executable: /bin/bash diff --git a/releasenotes/notes/fixes-slave-interface-bounce-81d8dc8e5e474447.yaml b/releasenotes/notes/fixes-slave-interface-bounce-81d8dc8e5e474447.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6875a6429619a06204570c327f5d7109b924fb6d --- /dev/null +++ b/releasenotes/notes/fixes-slave-interface-bounce-81d8dc8e5e474447.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue where slave interfaces would not be brought back up when + bouncing the master interface. + `LP#2072340 <https://bugs.launchpad.net/kayobe/+bug/2072340>`_. diff --git a/requirements.yml b/requirements.yml index 0dfd7d5993118b51af32bcc26f5d824ef602bd79..a934c95bd0424ecb6120587915f0b62b6fdda6a6 100644 --- a/requirements.yml +++ b/requirements.yml @@ -27,7 +27,7 @@ roles: # There are no versioned releases of this role. version: acd08fd126d0e442ab8b3bc518e37761390d8c2f - src: MichaelRigart.interfaces - version: v1.14.4 + version: v1.15.1 - src: mrlesmithjr.chrony version: v0.1.4 - src: mrlesmithjr.manage_lvm