2022-11-08 13:43:40 +00:00
|
|
|
- name: Configure clusterctl
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: clusterctl.j2
|
2022-11-24 09:59:41 +00:00
|
|
|
dest: /opt/metacluster/cluster-api/clusterctl.yaml
|
2022-11-08 13:43:40 +00:00
|
|
|
vars:
|
|
|
|
_template:
|
|
|
|
version:
|
|
|
|
base: "{{ components.clusterapi.management.version.base }}"
|
|
|
|
cert_manager: "{{ components.clusterapi.management.version.cert_manager }}"
|
|
|
|
infrastructure_vsphere: "{{ components.clusterapi.management.version.infrastructure_vsphere }}"
|
|
|
|
hv:
|
|
|
|
fqdn: "{{ vapp['hv.fqdn'] }}"
|
2022-11-17 09:17:17 +00:00
|
|
|
tlsthumbprint: "{{ tls_thumbprint.stdout }}"
|
2022-11-08 13:43:40 +00:00
|
|
|
username: "{{ vapp['hv.username'] }}"
|
|
|
|
password: "{{ vapp['hv.password'] }}"
|
|
|
|
datacenter: "{{ vcenter_info.datacenter }}"
|
|
|
|
datastore: "{{ vcenter_info.datastore }}"
|
|
|
|
network: "{{ vcenter_info.network }}"
|
2022-11-08 18:46:37 +00:00
|
|
|
resourcepool: "{{ vcenter_info.resourcepool }}"
|
2022-11-17 09:17:17 +00:00
|
|
|
folder: "{{ vcenter_info.folder }}"
|
2022-11-08 13:43:40 +00:00
|
|
|
cluster:
|
2022-11-09 15:59:43 +00:00
|
|
|
nodetemplate: "{{ (components.clusterapi.workload.node_template.name | split('.'))[:-1] | join('.') }}"
|
2022-11-08 13:43:40 +00:00
|
|
|
publickey: "{{ vapp['guestinfo.rootsshkey'] }}"
|
|
|
|
version: "{{ components.clusterapi.workload.version.k8s }}"
|
|
|
|
vip: "{{ vapp['workloadcluster.vip'] }}"
|
2022-11-09 15:43:49 +00:00
|
|
|
|
|
|
|
- name: Initialize Cluster API management cluster
|
|
|
|
ansible.builtin.shell:
|
2022-11-10 20:27:17 +00:00
|
|
|
cmd: clusterctl init -v5 -i vsphere:{{ components.clusterapi.management.version.infrastructure_vsphere }} --config ./clusterctl.yaml --kubeconfig {{ kubeconfig.path }}
|
2022-11-24 09:59:41 +00:00
|
|
|
chdir: /opt/metacluster/cluster-api
|