From 1e3fd54d705b4093ef64429e23b9ad6fecbb8df7 Mon Sep 17 00:00:00 2001 From: Davis Phillips Date: Mon, 11 Dec 2017 09:32:19 -0600 Subject: add vsphere cloud providers --- roles/openshift_cloud_provider/tasks/main.yml | 3 +++ roles/openshift_cloud_provider/vars/main.yml | 1 + 2 files changed, 4 insertions(+) (limited to 'roles/openshift_cloud_provider') diff --git a/roles/openshift_cloud_provider/tasks/main.yml b/roles/openshift_cloud_provider/tasks/main.yml index dff492a69..3513577fa 100644 --- a/roles/openshift_cloud_provider/tasks/main.yml +++ b/roles/openshift_cloud_provider/tasks/main.yml @@ -19,3 +19,6 @@ - include_tasks: gce.yml when: cloudprovider_is_gce | bool + +- include_tasks: vsphere.yml + when: cloudprovider_is_vsphere | bool diff --git a/roles/openshift_cloud_provider/vars/main.yml b/roles/openshift_cloud_provider/vars/main.yml index c9d953f58..e71db80b9 100644 --- a/roles/openshift_cloud_provider/vars/main.yml +++ b/roles/openshift_cloud_provider/vars/main.yml @@ -3,3 +3,4 @@ has_cloudprovider: "{{ openshift_cloudprovider_kind | default(None) != None }}" cloudprovider_is_aws: "{{ has_cloudprovider | bool and openshift_cloudprovider_kind == 'aws' }}" cloudprovider_is_openstack: "{{ has_cloudprovider | bool and openshift_cloudprovider_kind == 'openstack' }}" cloudprovider_is_gce: "{{ has_cloudprovider | bool and openshift_cloudprovider_kind == 'gce' }}" +cloudprovider_is_vsphere: "{{ has_cloudprovider | bool and openshift_cloudprovider_kind == 'vsphere' }}" -- cgit v1.2.3 From 805c4a3d5be1433ee38e495885fea185d1359561 Mon Sep 17 00:00:00 2001 From: Davis Phillips Date: Mon, 11 Dec 2017 09:33:59 -0600 Subject: add template and vsphere.conf --- roles/openshift_cloud_provider/tasks/vsphere.yml | 6 ++++++ roles/openshift_cloud_provider/templates/vsphere.conf.j2 | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 roles/openshift_cloud_provider/tasks/vsphere.yml create mode 100644 roles/openshift_cloud_provider/templates/vsphere.conf.j2 (limited to 'roles/openshift_cloud_provider') diff --git a/roles/openshift_cloud_provider/tasks/vsphere.yml b/roles/openshift_cloud_provider/tasks/vsphere.yml new file mode 100644 index 000000000..9197fb4bc --- /dev/null +++ b/roles/openshift_cloud_provider/tasks/vsphere.yml @@ -0,0 +1,6 @@ +--- +- name: Create cloud config + template: + dest: "{{ openshift.common.config_base }}/cloudprovider/vsphere.conf" + src: vsphere.conf.j2 + when: openshift_cloudprovider_vsphere_username is defined and openshift_cloudprovider_vsphere_password is defined and openshift_cloudprovider_vsphere_host is defined and openshift_cloudprovider_vsphere_datacenter is defined and openshift_cloudprovider_vsphere_datastore is defined diff --git a/roles/openshift_cloud_provider/templates/vsphere.conf.j2 b/roles/openshift_cloud_provider/templates/vsphere.conf.j2 new file mode 100644 index 000000000..84e5e371c --- /dev/null +++ b/roles/openshift_cloud_provider/templates/vsphere.conf.j2 @@ -0,0 +1,15 @@ +[Global] +user = "{{ openshift_cloudprovider_vsphere_username }}" +password = "{{ openshift_cloudprovider_vsphere_password }}" +server = "{{ openshift_cloudprovider_vsphere_host }}" +port = 443 +insecure-flag = 1 +datacenter = {{ openshift_cloudprovider_vsphere_datacenter }} +datastore = {{ openshift_cloudprovider_vsphere_datastore }} +{% if openshift_cloudprovider_vsphere_folder is defined %} +working-dir = /{{ openshift_cloudprovider_vsphere_datacenter }}/vm/{{ openshift_cloudprovider_vsphere_folder }}/ +{% else %} +working-dir = /{{ openshift_cloudprovider_vsphere_datacenter }}/vm/ +{% endif %} +[Disk] +scsicontrollertype = pvscsi -- cgit v1.2.3 From 52a55f2a5b16e8da59dd21180b077151e57617f2 Mon Sep 17 00:00:00 2001 From: Davis Phillips Date: Mon, 11 Dec 2017 10:01:26 -0600 Subject: lint issues --- roles/openshift_cloud_provider/tasks/vsphere.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/openshift_cloud_provider') diff --git a/roles/openshift_cloud_provider/tasks/vsphere.yml b/roles/openshift_cloud_provider/tasks/vsphere.yml index 9197fb4bc..3a33df241 100644 --- a/roles/openshift_cloud_provider/tasks/vsphere.yml +++ b/roles/openshift_cloud_provider/tasks/vsphere.yml @@ -3,4 +3,4 @@ template: dest: "{{ openshift.common.config_base }}/cloudprovider/vsphere.conf" src: vsphere.conf.j2 - when: openshift_cloudprovider_vsphere_username is defined and openshift_cloudprovider_vsphere_password is defined and openshift_cloudprovider_vsphere_host is defined and openshift_cloudprovider_vsphere_datacenter is defined and openshift_cloudprovider_vsphere_datastore is defined + when: openshift_cloudprovider_vsphere_username is defined and openshift_cloudprovider_vsphere_password is defined and openshift_cloudprovider_vsphere_host is defined and openshift_cloudprovider_vsphere_datacenter is defined and openshift_cloudprovider_vsphere_datastore is defined -- cgit v1.2.3