Browse Source

Merge pull request #6580 from tomassedovic/openstack-fixes

Automatic merge from submit-queue.

Openstack fixes

This includes a few fixes for the OpenStack provider.

It should fix #6555 and possibly also #6560.
OpenShift Merge Robot 7 years ago
parent
commit
74294d8258

+ 3 - 0
playbooks/openstack/openshift-cluster/install.yml

@@ -9,4 +9,7 @@
 # some logic here?
 
 - name: run the cluster deploy
+  import_playbook: ../../prerequisites.yml
+
+- name: run the cluster deploy
   import_playbook: ../../deploy_cluster.yml

+ 2 - 2
playbooks/openstack/sample-inventory/group_vars/OSEv3.yml

@@ -14,12 +14,12 @@ openshift_hosted_router_wait: True
 openshift_hosted_registry_wait: True
 
 ## Openstack credentials
-#openshift_cloudprovider_kind=openstack
+#openshift_cloudprovider_kind: openstack
 #openshift_cloudprovider_openstack_auth_url: "{{ lookup('env','OS_AUTH_URL') }}"
 #openshift_cloudprovider_openstack_username: "{{ lookup('env','OS_USERNAME') }}"
 #openshift_cloudprovider_openstack_password: "{{ lookup('env','OS_PASSWORD') }}"
 #openshift_cloudprovider_openstack_tenant_name: "{{ lookup('env','OS_TENANT_NAME') }}"
-#openshift_cloudprovider_openstack_region="{{ lookup('env', 'OS_REGION_NAME') }}"
+#openshift_cloudprovider_openstack_region: "{{ lookup('env', 'OS_REGION_NAME') }}"
 
 
 ## Use Cinder volume for Openshift registry:

+ 5 - 0
playbooks/openstack/sample-inventory/inventory.py

@@ -9,6 +9,7 @@ environment.
 
 from __future__ import print_function
 
+from collections import Mapping
 import json
 
 import shade
@@ -101,6 +102,10 @@ def build_inventory():
             hostvars['glusterfs_devices'] = ['/dev/nvme0n1']
 
         node_labels = server.metadata.get('node_labels')
+        # NOTE(shadower): the node_labels value must be a dict not string
+        if not isinstance(node_labels, Mapping):
+            node_labels = json.loads(node_labels)
+
         if node_labels:
             hostvars['openshift_node_labels'] = node_labels