Correct some mistakes

This commit is contained in:
Sergei Bobkov 2024-09-19 22:45:38 +03:00
parent df81645473
commit dee4f1a22b
6 changed files with 16 additions and 28 deletions

View File

@ -1,2 +1,2 @@
# Packer scripts
# Packer builds and scripts

0
packer/build.sh Executable file → Normal file
View File

View File

@ -6,3 +6,7 @@ For secrets and cred vars create $HOME/.secret/.packer/vcsrv-creds.pkrvars.hcl<b
`vcenter_username = "administrator@vsphere.local"`<br/>
`vcenter_password = "XXXXXXXXX"`<br/>
<br/>
`connection_username = "root"`<br/>
`connection_password = "XXXXXXXX"`<br/>
<br/>

View File

@ -4,23 +4,18 @@ vcenter_host = "esxi8-01.lab.loc"
vcenter_folder = "VLAN-0221"
vcenter_datastore = "Cluster01-LUN02"
vm_name = "zzzzzzz"
vm_name = "z-test-packer-vm"
vm_num_cpu = 1
vm_ram = 1024
vm_hardware_version = "21"
vm_hardware_version = "20"
vm_guest_os_type = "debian12_64Guest"
vm_disk_size = "4096"
vm_network = "VLAN-0221"
vm_network_nic_type = "vmxnet3"
iso_checksum = "none"
os_iso_paths = "[Cluster01-LUN01] ISO/debian-12.7.0-amd64-netinst.iso"
os_iso_url = "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.7.0-amd64-netinst.iso"
connection_username = "user"
connection_password = "user"
boot_command = "<esc><wait><esc><wait>/install.amd/vmlinuz <wait> ipv6.disable=1 <wait> auto=true <wait> netcfg/dhcp_timeout=30 <wait> priority=critical locale=en_US <wait> preseed/url=http://aassdd.ru/.my-preseed/debian/preseed.cfg --- <wait> initrd=/install.amd/initrd.gz<wait><enter>"

View File

@ -16,10 +16,10 @@ packer {
}
}
// BLOCK: locals
// Defines the local variables.
//locals {
// bbbbb = "aaaa"
// var1 = "var1"
//}
source "vsphere-iso" "debian-12" {
@ -49,11 +49,11 @@ source "vsphere-iso" "debian-12" {
network_card = var.vm_network_nic_type
}
// ****************
ip_wait_timeout = "45m"
ssh_username = var.connection_username
ssh_password = var.connection_password
ssh_timeout = "12h"
ssh_port = "22"
ip_wait_timeout = "15m"
ssh_timeout = "10m"
ssh_handshake_attempts = "20"
shutdown_timeout = "15m"
// ****************
@ -63,20 +63,9 @@ source "vsphere-iso" "debian-12" {
// ****************
boot_wait = "5s"
boot_command = [
"<esc><wait>",
"<esc><wait>",
"/install.amd/vmlinuz <wait>",
"ipv6.disable=1 <wait>",
"auto=true <wait>",
"netcfg/dhcp_timeout=30 <wait>",
"priority=critical locale=en_US <wait>",
"preseed/url=http://aassdd.ru/.my-preseed/debian/preseed.cfg <wait>",
"--- <wait>",
"initrd=/install.amd/initrd.gz<wait><enter>"
]
}
boot_command = [var.boot_command]
}
build {
name = "template"