forked from msvsphere/cloud-images
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.5 KiB
53 lines
1.5 KiB
2 months ago
|
/**
|
||
|
* Packer template for building MSVSphere 9 ovf image.
|
||
|
*/
|
||
|
|
||
|
source "vmware-iso" "msvsphere-9-ovf-x86_64" {
|
||
|
vm_name = "msvsphere-9.4"
|
||
|
iso_url = var.iso_url_9_x86_64
|
||
|
iso_checksum = var.iso_checksum_9_x86_64
|
||
|
boot_command = var.ovf_boot_cmd_9_x86_64_bios
|
||
|
boot_wait = var.boot_wait
|
||
|
cpus = var.cpus
|
||
|
memory = var.memory
|
||
|
disk_size = var.vmware_disk_size
|
||
|
headless = var.headless
|
||
|
http_directory = var.http_directory
|
||
|
guest_os_type = "centos-64"
|
||
|
shutdown_command = var.root_shutdown_command
|
||
|
ssh_username = var.ovf_ssh_username
|
||
|
ssh_password = var.ovf_ssh_password
|
||
|
ssh_timeout = var.ssh_timeout
|
||
|
version = 15
|
||
|
vmx_data = {
|
||
|
"cpuid.coresPerSocket" : "1"
|
||
|
}
|
||
|
vmx_data_post = {
|
||
|
"memsize" : var.post_memory
|
||
|
"numvcpus" : var.post_cpus
|
||
|
}
|
||
|
vmx_remove_ethernet_interfaces = true
|
||
|
}
|
||
|
|
||
|
|
||
|
build {
|
||
|
sources = [
|
||
|
"sources.vmware-iso.msvsphere-9-ovf-x86_64"
|
||
|
]
|
||
|
provisioner "ansible" {
|
||
|
playbook_file = "ansible/ovf.yml"
|
||
|
galaxy_file = "ansible/requirements.yml"
|
||
|
roles_path = "ansible/roles"
|
||
|
collections_path = "ansible/collections"
|
||
|
ansible_env_vars = [
|
||
|
"ANSIBLE_PIPELINING=True",
|
||
|
"ANSIBLE_REMOTE_TEMP=/tmp",
|
||
|
"ANSIBLE_SSH_ARGS='-o ControlMaster=no -o ControlPersist=180s -o ServerAliveInterval=120s -o TCPKeepAlive=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa'"
|
||
|
]
|
||
|
extra_arguments = [
|
||
|
"--extra-vars",
|
||
|
"packer_provider=${source.type}"
|
||
|
]
|
||
|
}
|
||
|
}
|