From 2a7f74ac996317a1ed87923cac4561a8c2546f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Fri, 7 May 2021 09:46:46 +0200 Subject: [PATCH] tripleo_ovn_mac_addresses - ignore no neutron If neutron service or auth options are not present, i.e standalone deployment without static_mappings. Then simply exit ok, and do nothing. Standalone never had an ovn bridge mac address interface prior to this anyway. So doing nothing should be ok. Closes-Bug: #1927556 Change-Id: Ic323fccd4e30ee5a5b490a4a137735426f39ca66 --- .../modules/tripleo_ovn_mac_addresses.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tripleo_ansible/ansible_plugins/modules/tripleo_ovn_mac_addresses.py b/tripleo_ansible/ansible_plugins/modules/tripleo_ovn_mac_addresses.py index bd1e2422f..bd038b4e2 100644 --- a/tripleo_ansible/ansible_plugins/modules/tripleo_ovn_mac_addresses.py +++ b/tripleo_ansible/ansible_plugins/modules/tripleo_ovn_mac_addresses.py @@ -19,6 +19,8 @@ from concurrent import futures import os import yaml +import keystoneauth1.exceptions as kauth1_exc + try: from ansible.module_utils import network_data_v2 except ImportError: @@ -238,7 +240,14 @@ def run_module(): try: if not static_mappings: - _, conn = openstack_cloud_from_module(module) + try: + _, conn = openstack_cloud_from_module(module) + if conn.identity.find_service('neutron') is None: + result['success'] = True + module.exit_json(**result) + except kauth1_exc.MissingRequiredOptions: + result['success'] = True + module.exit_json(**result) net_id = create_ovn_mac_address_network(result, conn) tags = ['tripleo_stack_name={}'.format(stack),