/* * MSVSphere OS 8 Packer template for building Generic Cloud (OpenStack compatible) images. */ source "qemu" "msvsphere-8-yandexcloud-x86_64" { iso_url = var.iso_url_8_x86_64 iso_checksum = var.iso_checksum_8_x86_64 shutdown_command = var.root_shutdown_command accelerator = "kvm" http_directory = var.http_directory ssh_username = var.gencloud_ssh_username ssh_password = var.gencloud_ssh_password ssh_timeout = var.ssh_timeout vnc_bind_address = var.vnc_bind_address vnc_port_min = var.vnc_port_min vnc_port_max = var.vnc_port_max cpus = var.cpus efi_firmware_code = var.uefi_ovmf_code efi_firmware_vars = var.uefi_ovmf_vars disk_interface = "virtio-scsi" disk_size = var.gencloud_disk_size disk_cache = "unsafe" disk_discard = "unmap" disk_detect_zeroes = "unmap" disk_compression = true format = "qcow2" headless = var.headless machine_type = "q35" memory = var.memory net_device = "virtio-net" qemu_binary = var.qemu_binary vm_name = "MSVSphere-${var.os_version_8}-${formatdate("YYYYMMDD", timestamp())}.yandexcloud.x86_64.qcow2" boot_wait = var.boot_wait boot_command = var.gencloud_boot_cmd_8_x86_64_uefi } build { sources = [ "qemu.msvsphere-8-yandexcloud-x86_64" ] provisioner "ansible" { playbook_file = "ansible/yandexcloud.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_SCP_EXTRA_ARGS=-O", "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", "is_unified_boot=true", ] } }