From 9483037f5d8b925ad557b47808787212959af9fb Mon Sep 17 00:00:00 2001 From: Jakub Libosvar Date: Tue, 23 Mar 2021 09:54:43 +0100 Subject: [PATCH] ovn-migration: Add doctext explaining VXLAN to Geneve migration The Ansible command itself is hard to read, the patch adds some doctext to improve understanding of the ansible task. Change-Id: I4ab7a83da9bbf64ee6b19b2a0611fd64e09e2132 Signed-off-by: Jakub Libosvar --- .../roles/prepare-controllers/tasks/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/ovn_migration/tripleo_environment/playbooks/roles/prepare-controllers/tasks/main.yml b/tools/ovn_migration/tripleo_environment/playbooks/roles/prepare-controllers/tasks/main.yml index 90755375f74..949656e8ce3 100644 --- a/tools/ovn_migration/tripleo_environment/playbooks/roles/prepare-controllers/tasks/main.yml +++ b/tools/ovn_migration/tripleo_environment/playbooks/roles/prepare-controllers/tasks/main.yml @@ -4,6 +4,17 @@ when: ovn_central is defined register: mysql_url +# The shell below is not readable well. The code spawns a sqlalchemy engine +# and connects to the Neutron database to run following SQL command: +# UPDATE networksegments SET networksegments.network_type='geneve' WHERE networksegments.network_type='vxlan'; +# The indented Python code looks as follows: +# +# from sqlalchemy import create_engine +# +# engine = create_engine("{{ mysql_url.stdout }}") +# with engine.connect() as conn: +# conn.execute("SQL COMMAND") +# - name: Change vxlan networks to Geneve shell: podman exec -it neutron_api python3 -c $'from sqlalchemy import create_engine\nengine = create_engine("{{ mysql_url.stdout }}")\nwith engine.connect() as conn:\n\tconn.execute("update networksegments set networksegments.network_type=\'geneve\' where networksegments.network_type=\'vxlan\';")' when: ovn_central is defined