From 676935b4e59f0b3bfb7e6daeb68863238bb85837 Mon Sep 17 00:00:00 2001 From: Jakub Libosvar Date: Fri, 19 Mar 2021 12:07:12 +0100 Subject: [PATCH] ovn-migration: Use DHCP nodes to configure dnsmasq Previously, the migration script used controller nodes to configure dnsmasq when configuring new MTU. Controller nodes may not run DHCP agents. The patch detects DHCP agents instead and uses those to configure dnsmasq. Closes-bug: #1928450 Change-Id: Ib468c04779af7aaf4dedf84ba885bce71078248b Signed-off-by: Jakub Libosvar (cherry picked from commit 569aa4452a42d884f365fc7800164a9f7f984687) --- .../tripleo_environment/ovn_migration.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/ovn_migration/tripleo_environment/ovn_migration.sh b/tools/ovn_migration/tripleo_environment/ovn_migration.sh index 742c457d5ce..76ccf71e266 100644 --- a/tools/ovn_migration/tripleo_environment/ovn_migration.sh +++ b/tools/ovn_migration/tripleo_environment/ovn_migration.sh @@ -126,6 +126,8 @@ EOF # Generate the inventory file for ansible migration playbook. generate_ansible_inventory_file() { + local dhcp_nodes + echo "Generating the inventory file for ansible-playbook" source $STACKRC_FILE echo "[ovn-dbs]" > hosts_for_migration @@ -153,13 +155,22 @@ generate_ansible_inventory_file() { node_ip=$(get_host_ip "$inventory_file" $node_name) echo $node_name ansible_host=$node_ip ansible_ssh_user=$UNDERCLOUD_NODE_USER ansible_become=true ovn_controller=true >> hosts_for_migration done + + echo "" >> hosts_for_migration + echo "[dhcp]" >> hosts_for_migration + dhcp_nodes=$(get_group_hosts "$inventory_file" neutron_dhcp) + for node_name in $dhcp_nodes; do + node_ip=$(get_host_ip "$inventory_file" $node_name) + echo $node_name ansible_host=$node_ip ansible_ssh_user=$UNDERCLOUD_NODE_USER ansible_become=true >> hosts_for_migration + done + rm -f "$inventory_file" echo "" >> hosts_for_migration cat >> hosts_for_migration << EOF [overcloud-controllers:children] -ovn-dbs +dhcp [overcloud:children] ovn-controllers