chore: further ovn cleanup
diff --git a/roles/neutron/tasks/main.yml b/roles/neutron/tasks/main.yml
index b1741a4..5853b31 100644
--- a/roles/neutron/tasks/main.yml
+++ b/roles/neutron/tasks/main.yml
@@ -42,8 +42,28 @@
- name: Add OVN configuration
when: neutron_ovn_enabled | bool
- ansible.builtin.set_fact:
- _neutron_helm_values: "{{ _neutron_helm_values | combine(__neutron_ovn_helm_values, recursive=True) }}"
+ block:
+ - name: Retrieve OVN Northbound service IP
+ kubernetes.core.k8s_info:
+ api_version: v1
+ kind: Service
+ name: ovn-ovsdb-nb
+ namespace: "{{ neutron_helm_release_namespace }}"
+ register: neutron_ovn_nb_svc
+ failed_when: neutron_ovn_nb_svc.resources | length == 0
+
+ - name: Retrieve OVN Southbound service IP
+ kubernetes.core.k8s_info:
+ api_version: v1
+ kind: Service
+ name: ovn-ovsdb-sb
+ namespace: "{{ neutron_helm_release_namespace }}"
+ register: neutron_ovn_sb_svc
+ failed_when: neutron_ovn_sb_svc.resources | length == 0
+
+ - name: Append Helm values
+ ansible.builtin.set_fact:
+ _neutron_helm_values: "{{ _neutron_helm_values | combine(__neutron_ovn_helm_values, recursive=True) }}"
- name: Deploy Helm chart
run_once: true
diff --git a/roles/neutron/vars/main.yml b/roles/neutron/vars/main.yml
index 0ee5396..a100837 100644
--- a/roles/neutron/vars/main.yml
+++ b/roles/neutron/vars/main.yml
@@ -79,8 +79,8 @@
dns_servers: "{{ neutron_coredns_cluster_ip | default('10.96.0.20') }}"
enable_distributed_floating_ip: true
ovn_metadata_enabled: true
- ovn_nb_connection: "{% for n in range(ovn_helm_values.get('pod', {}).get('replicas', {}).get('ovn_ovsdb_nb', 3)) %}tcp:ovn-ovsdb-nb-{{ n }}.{{ neutron_helm_release_namespace }}.svc.cluster.local:6643{% if not loop.last %},{% endif %}{% endfor %}"
- ovn_sb_connection: "{% for n in range(ovn_helm_values.get('pod', {}).get('replicas', {}).get('ovn_ovsdb_sb', 3)) %}tcp:ovn-ovsdb-sb-{{ n }}.{{ neutron_helm_release_namespace }}.svc.cluster.local:6642{% if not loop.last %},{% endif %}{% endfor %}"
+ ovn_nb_connection: "tcp:{{ neutron_ovn_nb_svc.resources[0].spec.clusterIP }}:{{ neutron_ovn_nb_svc.resources[0].spec.ports[0].port }}"
+ ovn_sb_connection: "tcp:{{ neutron_ovn_sb_svc.resources[0].spec.clusterIP }}:{{ neutron_ovn_sb_svc.resources[0].spec.ports[0].port }}"
ovn_metadata_agent:
DEFAULT:
nova_metadata_host: nova-metadata.openstack.svc.cluster.local