mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-12 20:07:39 -02:30
Updating vsphere cloud provider support
This commit is contained in:
@@ -64,21 +64,13 @@
|
||||
|
||||
- name: check cloud_provider value
|
||||
fail:
|
||||
msg: "If set the 'cloud_provider' var must be set either to 'generic', 'gce', 'aws', 'azure', 'vsphere', or 'openstack'"
|
||||
when: cloud_provider is defined and cloud_provider not in ['generic', 'gce', 'aws', 'openstack', 'azure', 'vsphere']
|
||||
msg: "If set the 'cloud_provider' var must be set either to 'generic', 'gce', 'aws', 'azure', 'openstack' or 'vsphere'"
|
||||
when: cloud_provider is defined and cloud_provider not in ['generic', 'gce', 'aws', 'azure', 'openstack', 'vsphere']
|
||||
tags: [cloud-provider, facts]
|
||||
|
||||
- include: openstack-credential-check.yml
|
||||
when: cloud_provider is defined and cloud_provider == 'openstack'
|
||||
tags: [cloud-provider, openstack, facts]
|
||||
|
||||
- include: azure-credential-check.yml
|
||||
when: cloud_provider is defined and cloud_provider == 'azure'
|
||||
tags: [cloud-provider, azure, facts]
|
||||
|
||||
- include: vsphere-credential-check.yml
|
||||
when: cloud_provider is defined and cloud_provider == 'vsphere'
|
||||
tags: [cloud-provider, vsphere, facts]
|
||||
- include: "{{ cloud_provider }}-credential-check.yml"
|
||||
when: cloud_provider is defined and cloud_provider in [ 'openstack', 'azure', 'vsphere' ]
|
||||
tags: [cloud-provider, "{{ cloud_provider }}", facts]
|
||||
|
||||
- name: Create cni directories
|
||||
file:
|
||||
@@ -183,23 +175,14 @@
|
||||
state: present
|
||||
tags: bootstrap-os
|
||||
|
||||
- name: "Write {{ cloud_provider}} cloud-config"
|
||||
- name: Write cloud-config
|
||||
template:
|
||||
src: "{{ cloud_provider }}-cloud-config.j2"
|
||||
dest: "{{ kube_config_dir }}/cloud_config"
|
||||
group: "{{ kube_cert_group }}"
|
||||
mode: 0640
|
||||
when: inventory_hostname in groups['k8s-cluster'] and cloud_provider is defined and cloud_provider in [ "openstack", "vsphere" ]
|
||||
tags: [cloud-provider, openstack, vsphere]
|
||||
|
||||
- name: Write azure cloud-config
|
||||
template:
|
||||
src: azure-cloud-config.j2
|
||||
dest: "{{ kube_config_dir }}/cloud_config"
|
||||
group: "{{ kube_cert_group }}"
|
||||
mode: 0640
|
||||
when: inventory_hostname in groups['k8s-cluster'] and cloud_provider is defined and cloud_provider == "azure"
|
||||
tags: [cloud-provider, azure]
|
||||
when: inventory_hostname in groups['k8s-cluster'] and cloud_provider is defined and cloud_provider in [ 'openstack', 'azure', 'vsphere' ]
|
||||
tags: [cloud-provider, "{{ cloud_provider }}"]
|
||||
|
||||
- include: etchosts.yml
|
||||
tags: [bootstrap-os, etchosts]
|
||||
|
||||
@@ -1,30 +1,21 @@
|
||||
---
|
||||
- name: check vsphere_username value
|
||||
- name: check vsphere environment variables
|
||||
fail:
|
||||
msg: "vsphere_username is missing"
|
||||
when: vsphere_username is not defined or vsphere_username == ""
|
||||
|
||||
- name: check vsphere_password value
|
||||
fail:
|
||||
msg: "vsphere_password is missing"
|
||||
when: vsphere_password is not defined or vsphere_password == ""
|
||||
|
||||
- name: check vsphere_server value
|
||||
fail:
|
||||
msg: "vsphere_server is missing"
|
||||
when: vsphere_server is not defined or vsphere_server == ""
|
||||
|
||||
- name: check vsphere_datacenter value
|
||||
fail:
|
||||
msg: "vsphere_datacenter is missing"
|
||||
when: vsphere_datacenter is not defined or vsphere_datacenter == ""
|
||||
|
||||
- name: check vsphere_datastore value
|
||||
fail:
|
||||
msg: "vsphere_datastore is missing"
|
||||
when: vsphere_datastore is not defined or vsphere_datastore == ""
|
||||
|
||||
- name: check vsphere_working_dir value
|
||||
fail:
|
||||
msg: "vsphere_working_dir is missing"
|
||||
when: vsphere_working_dir is not defined or vsphere_working_dir == ""
|
||||
msg: "{{ item.name }} is missing"
|
||||
when: item.value is not defined or item.value == ''
|
||||
with_items:
|
||||
- name: vsphere_vcenter_ip
|
||||
value: "{{ vsphere_vcenter_ip }}"
|
||||
- name: vsphere_vcenter_port
|
||||
value: "{{ vsphere_vcenter_port }}"
|
||||
- name: vsphere_user
|
||||
value: "{{ vsphere_user }}"
|
||||
- name: vsphere_password
|
||||
value: "{{ vsphere_password }}"
|
||||
- name: vsphere_datacenter
|
||||
value: "{{ vsphere_datacenter }}"
|
||||
- name: vsphere_datastore
|
||||
value: "{{ vsphere_datastore }}"
|
||||
- name: vsphere_working_dir
|
||||
value: "{{ vsphere_working_dir }}"
|
||||
- name: vsphere_insecure
|
||||
value: "{{ vsphere_insecure }}"
|
||||
|
||||
Reference in New Issue
Block a user