This module creates a bootstrapping server on vSphere to assist creating machines.
This module requires a template host VM to clone from. This machine will be expected to provide certain aspects listed down here.
- Ubuntu 20.04
/etc/sudoerscontains%sudo ALL=(ALL:ALL) NOPASSWD:ALL.- Steps listed here to disable
cloud-init:sudo touch /etc/cloud/cloud-init.disabledsudo apt-get purge cloud-init- Comment
/usr/lib/tmpfiles.d/tmp.confline setting/tmppermissions:#/tmp 1777 root root -
- Update the
/lib/systemd/system/open-vm-tools.serviceafteropen-vm-toolsis installed:- Add
"After=dbus.service"under[Unit]
- Add
- set the IP address to the same as the
management_ipv4_addressin case customization doesn't work as expected.
open-vm-toolsperl
ubuntu/home/ubuntu/.ssh/authorized_keysset with the SSH public key provided infiles,ubuntu.pub.- Member of the
sudogroup. - NOTE: this user will be destroyed at the end of deployment.
To use this module, in your main.tf TerraForm code for a deployment insert the following:
module "bootstrap-1" { source = "github.com/frozenfoxx/terraform-bootstrap-vsphere" authkeys = var.authkeys cluster = var.cluster datacenter = var.datacenter dataroot = "[Path for TFTP data root]" datastore = var.datastore dhcpstart = "[DHCP range Start IP]" dhcpstop = "[DHCP range Stop IP]" folder = var.folder management_dns_servers = var.management_dns_servers management_domain = var.management_domain management_gateway = var.management_gateway management_ipv4_address = "[Management Network IP]" management_ipv4_prefix_length = "[Management Subnet Mask]" management_netlabel = var.management_netlabel name = "[Hostname]" password = var.password template = var.template username = var.username vmtimez = var.vmtimez } The username, password, and authkeys fields are to deploy a persistent, administrative user after deployment. This is to maintain access given the ubuntu user will be destroyed as part of deployment.