From 2db1c4d62345f8c3779d660c99e5fce88d5369d4 Mon Sep 17 00:00:00 2001 From: djpbessems Date: Wed, 12 Jun 2024 12:28:58 +1000 Subject: [PATCH] chore: Add deployment playbook --- .gitignore | 4 +++ deployment/playbook.yml | 48 ++++++++++++++++++++++++++++++++++++ deployment/requirements.yaml | 5 ++++ 3 files changed, 57 insertions(+) create mode 100644 .gitignore create mode 100644 deployment/playbook.yml create mode 100644 deployment/requirements.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b229fa --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +**/hv.vcenter.yaml +**/ova.bootstrap.yaml +**/pb.secrets.yaml +**/pwdfile diff --git a/deployment/playbook.yml b/deployment/playbook.yml new file mode 100644 index 0000000..7f7f653 --- /dev/null +++ b/deployment/playbook.yml @@ -0,0 +1,48 @@ +- hosts: localhost + vars_files: + - vars/ova.bootstrap.yaml + - vars/hv.vcenter.yaml + - vars/pb.secrets.yaml + tasks: + + - name: Deploy VM from OVA-template + community.vmware.vmware_deploy_ovf: + hostname: "{{ hv.hostname }}" + username: "{{ hv.username }}" + password: "{{ secrets.hv.password }}" + validate_certs: no + datacenter: "{{ hv.datacenter }}" + folder: "{{ hv.folder }}" + cluster: "{{ hv.cluster }}" + name: airgapped-k8s-meta1 + datastore: "{{ hv.datastore }}" + disk_provisioning: thin + networks: + "LAN": "{{ hv.network }}" + power_on: yes + ovf: "{{ appliance.path }}/{{ appliance.filename }}" + deployment_option: cp1w1ws0 + properties: + metacluster.fqdn: k8s.lab + metacluster.vip: 192.168.154.125 + metacluster.token: "{{ secrets.appliance.installtoken }}" + # guestinfo.hostname: _default + metacluster.password: "{{ secrets.appliance.password }}" + guestinfo.ipaddress: 192.168.154.126 + guestinfo.prefixlength: '24' + guestinfo.dnsserver: 192.168.154.225 + guestinfo.gateway: 192.168.154.1 + # workloadcluster.name: _default + workloadcluster.vip: 192.168.154.130 + ippool.startip: 192.168.154.135 + ippool.endip: 192.168.154.140 + workloadcluster.nodetemplate: ubuntu-2204-kube-v1.30.0 + workloadcluster.nodesize: small + # workloadcluster.additionaldisk: '75' + guestinfo.rootsshkey: ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAiRc7Og+cRJGFwdUzgpX9YqvVenTk54N4kqM7emEfYHdsJLMjKQyxr8hklHmsam5dzxx3itFzc6SLf/ldJJ2JZuzE5FiCqUXXv4UFwN6HF5xqn7PTLicvWZH93H4m1gOlD5Dfzi4Es34v5zRBwbMScOgekk/LweTgl35jGKDgMP5DjGTqkPf7Ndh9+iuQrz99JEr8egl3bj+jIlKjScfaQbbnu3AJIRwZwTKgw0AOkLliQdEPNLvG5/ZImxJG4oHV9/uNkfdJObLjT1plR1HbVNskV5fuRNE/vnUiWl9jAJ1RT83GOqV0sQ+Q7p214fkgqb3JPvci/s0Bb7RA85hBEQ== bessems.eu + hv.fqdn: "{{ hv.hostname }}" + hv.username: "{{ hv.username }}" + hv.password: "{{ secrets.hv.password }}" + ldap.fqdn: _unused + ldap.dn: _unused + ldap.password: _unused diff --git a/deployment/requirements.yaml b/deployment/requirements.yaml new file mode 100644 index 0000000..9362237 --- /dev/null +++ b/deployment/requirements.yaml @@ -0,0 +1,5 @@ +collections: +# - ansible.posix +# - ansible.utils +# - community.general +- community.vmware