소스 검색

Fix multimaster OpenStack deployment failure

When trying to deploy multimaster OpenStack with nsupdate and either no
load balancer or OpenStack LBaaS, the creation of the DNS records would
fail.

This is because it was still relying on the old `lb` inventory group for
all multimaster scenarios, rather than just in the
`openshift_openstack_use_lbaas_load_balancer` case.

So we define a new inventory variable
`openshift_openstack_private_api_ip` (which is already defined in the
Heat templates) and use that instead.
Tomas Sedovic 6 년 전
부모
커밋
2e1ee714aa
2개의 변경된 파일6개의 추가작업 그리고 10개의 파일을 삭제
  1. 2 0
      playbooks/openstack/inventory.py
  2. 4 10
      roles/openshift_openstack/tasks/generate-dns.yml

+ 2 - 0
playbooks/openstack/inventory.py

@@ -174,6 +174,8 @@ def build_inventory():
         except KeyError:
         except KeyError:
             pass  # Internal LB not specified
             pass  # Internal LB not specified
 
 
+        inventory['localhost']['openshift_openstack_private_api_ip'] = \
+            stout.get('private_api_ip')
         inventory['localhost']['openshift_openstack_public_api_ip'] = \
         inventory['localhost']['openshift_openstack_public_api_ip'] = \
             stout.get('public_api_ip')
             stout.get('public_api_ip')
         inventory['localhost']['openshift_openstack_public_router_ip'] = \
         inventory['localhost']['openshift_openstack_public_router_ip'] = \

+ 4 - 10
roles/openshift_openstack/tasks/generate-dns.yml

@@ -10,19 +10,12 @@
   with_items: "{{ groups['infra_hosts'] }}"
   with_items: "{{ groups['infra_hosts'] }}"
   when: openshift_openstack_public_router_ip is defined
   when: openshift_openstack_public_router_ip is defined
 
 
-- name: "Add public master cluster hostname records to the private A records (single master)"
+- name: "Add public master cluster hostname records to the private A records"
   set_fact:
   set_fact:
-    private_records: "{{ private_records | default([]) + [ { 'type': 'A', 'fqdn': hostvars[groups.masters[0]].openshift_master_cluster_public_hostname, 'ip': hostvars[groups.masters[0]].private_v4 } ] }}"
+    private_records: "{{ private_records | default([]) + [ { 'type': 'A', 'fqdn': hostvars[groups.masters[0]].openshift_master_cluster_public_hostname, 'ip': openshift_openstack_private_api_ip } ] }}"
   when:
   when:
     - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined
     - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined
-    - openshift_openstack_num_masters == 1
-
-- name: "Add public master cluster hostname records to the private A records (multi-master)"
-  set_fact:
-    private_records: "{{ private_records | default([]) + [ { 'type': 'A', 'fqdn': hostvars[groups.masters[0]].openshift_master_cluster_public_hostname, 'ip': hostvars[groups.lb[0]].private_v4 } ] }}"
-  when:
-    - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined
-    - openshift_openstack_num_masters > 1
+    - openshift_openstack_private_api_ip is defined
 
 
 - name: "Set the private DNS server to use the external value (if provided)"
 - name: "Set the private DNS server to use the external value (if provided)"
   set_fact:
   set_fact:
@@ -63,6 +56,7 @@
     public_records: "{{ public_records | default([]) + [ { 'type': 'A', 'fqdn': hostvars[groups.masters[0]].openshift_master_cluster_public_hostname, 'ip': openshift_openstack_public_api_ip } ] }}"
     public_records: "{{ public_records | default([]) + [ { 'type': 'A', 'fqdn': hostvars[groups.masters[0]].openshift_master_cluster_public_hostname, 'ip': openshift_openstack_public_api_ip } ] }}"
   when:
   when:
     - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined
     - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined
+    - openshift_openstack_public_api_ip is defined
 
 
 - name: "Set the public DNS server details to use the external value (if provided)"
 - name: "Set the public DNS server details to use the external value (if provided)"
   set_fact:
   set_fact: