diff options
author | Scott Dodson <sdodson@redhat.com> | 2018-02-01 13:50:17 -0500 |
---|---|---|
committer | Scott Dodson <sdodson@redhat.com> | 2018-02-01 14:33:59 -0500 |
commit | 5c8c156cfb3221a5fe541f6f4d94b5487938b923 (patch) | |
tree | dd787fc18b5ef79e3434cc0db9fd86cd5be4e066 /roles | |
parent | 4fe88b001295566d49db1fe711870bf43c40c1ab (diff) | |
download | openshift-5c8c156cfb3221a5fe541f6f4d94b5487938b923.tar.gz openshift-5c8c156cfb3221a5fe541f6f4d94b5487938b923.tar.bz2 openshift-5c8c156cfb3221a5fe541f6f4d94b5487938b923.tar.xz openshift-5c8c156cfb3221a5fe541f6f4d94b5487938b923.zip |
Set a default for required vsphere variable
Check for required variables in sanitize inventory
Diffstat (limited to 'roles')
-rw-r--r-- | roles/openshift_default_storage_class/defaults/main.yml | 3 | ||||
-rw-r--r-- | roles/openshift_sanitize_inventory/tasks/main.yml | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/roles/openshift_default_storage_class/defaults/main.yml b/roles/openshift_default_storage_class/defaults/main.yml index 7ca122fc9..687d60171 100644 --- a/roles/openshift_default_storage_class/defaults/main.yml +++ b/roles/openshift_default_storage_class/defaults/main.yml @@ -1,4 +1,7 @@ --- +# Must not be blank if you're using vsphere +openshift_cloudprovider_vsphere_datacenter: '' + openshift_storageclass_defaults: aws: provisioner: aws-ebs diff --git a/roles/openshift_sanitize_inventory/tasks/main.yml b/roles/openshift_sanitize_inventory/tasks/main.yml index 62d460272..feb5de668 100644 --- a/roles/openshift_sanitize_inventory/tasks/main.yml +++ b/roles/openshift_sanitize_inventory/tasks/main.yml @@ -61,3 +61,17 @@ when: - template_service_broker_remove | default(false) | bool - template_service_broker_install | default(true) | bool + +- name: Ensure that all requires vsphere configuration variables are set + fail: + msg: > + When the vSphere cloud provider is configured you must define all of these variables: + openshift_cloudprovider_vsphere_username, openshift_cloudprovider_vsphere_password, + openshift_cloudprovider_vsphere_host, openshift_cloudprovider_vsphere_datacenter, + openshift_cloudprovider_vsphere_datastore, openshift_cloudprovider_vsphere_folder + when: + - openshift_cloudprovider_kind is defined + - openshift_cloudprovider_kind == 'vsphere' + - ( openshift_cloudprovider_vsphere_username is undefined or openshift_cloudprovider_vsphere_password is undefined or + openshift_cloudprovider_vsphere_host is undefined or openshift_cloudprovider_vsphere_datacenter is undefined or + openshift_cloudprovider_vsphere_datastore is undefined or openshift_cloudprovider_vsphere_folder ) |