diff --git a/data/QuickAndDirty/almalinux8.pkr.hcl b/data/QuickAndDirty/almalinux8.pkr.hcl new file mode 100644 index 0000000..2068672 --- /dev/null +++ b/data/QuickAndDirty/almalinux8.pkr.hcl @@ -0,0 +1,75 @@ +packer { +} + +variable "ISODISK" { + type = string + default = "ISOS:iso/AlmaLinux-8.7-x86_64-dvd.iso" +} + +variable "ISOCKSUM" { + type = string + default = "b95ddf9d56a849cc8eb4b95dd2321c13af637d3379b91f5d96c39e96fb4403b3" +} + +source "proxmox" "alma" { + template_name = "alma" + template_description = "Alma Linux 8 Server template" + proxmox_url = "https://192.168.111.34:8006/api2/json" + node = "grosnoeud" + iso_file = var.ISODISK + iso_checksum = var.ISOCKSUM + insecure_skip_tls_verify = true + pool = "Linux-VM" + vm_name = "PackerTest" + vm_id = 665 + memory = 2048 + cores = 1 + sockets = 2 + os = "l26" + http_port_min = 4990 + http_port_max = 4999 + http_directory = "redhat" + username = "root@pam" + password = "bzzYpm8koNtPKFYjpjXSyjFY" + ssh_username = "root" + ssh_password = "M0ukreneIsVeryGood!" + ssh_timeout = "15m" + #username = "packer_build@pam" + #password = "tvowyfv9gh23sdfAERtLWav2674" + #ssh_username = "packer_build" + #ssh_password = "tvowyfv9gh23sdfAERtLWav2674" + network_adapters { + model = "virtio" + bridge = "vmbr111" + } + + qemu_agent = true + scsi_controller = "virtio-scsi-pci" + + disks { + type = "scsi" + disk_size = "55G" + storage_pool = "FAST" + storage_pool_type = "lvm-thin" + format = "raw" + } + boot_wait = "5s" + boot_command = [" inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/redhat.kix"] +} + +build { + sources = [ "source.proxmox.alma" ] + + provisioner "ansible" { + pause_before = "20s" + ansible_env_vars= [ + "ANSIBLE_HOST_KEY_CHECKING=False", + "ANSIBLE_SSH_ARGS='-o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s'", + "ANSIBLE_NOCOLOR=True" + ] + extra_arguments= [ + "-e templating=true" + ] + playbook_file = "../../../Ansible/playbooks/MyLinuxServers.yaml" + } +} \ No newline at end of file diff --git a/data/QuickAndDirty/almalinux9.pkr.hcl b/data/QuickAndDirty/almalinux9.pkr.hcl new file mode 100644 index 0000000..87b6ccf --- /dev/null +++ b/data/QuickAndDirty/almalinux9.pkr.hcl @@ -0,0 +1,75 @@ +packer { +} + +variable "ISODISK" { + type = string + default = "ISOS:iso/AlmaLinux-9.0-x86_64-dvd.iso" +} + +variable "ISOCKSUM" { + type = string + default = "6617436f8f2ee5408ff448a4eedce4ce61e2fdb3153a646b875010256bc9fd6b" +} + +source "proxmox" "alma" { + template_name = "alma9" + template_description = "Alma Linux 9 Server template" + proxmox_url = "https://192.168.111.34:8006/api2/json" + node = "grosnoeud" + iso_file = var.ISODISK + iso_checksum = var.ISOCKSUM + insecure_skip_tls_verify = true + pool = "Linux-VM" + vm_name = "PackerTest" + vm_id = 776 + memory = 2048 + cores = 1 + sockets = 2 + os = "l26" + http_port_min = 4990 + http_port_max = 4999 + http_directory = "redhat" + username = "root@pam" + password = "bzzYpm8koNtPKFYjpjXSyjFY" + ssh_username = "root" + ssh_password = "M0ukreneIsVeryGood!" + ssh_timeout = "15m" + #username = "packer_build@pam" + #password = "tvowyfv9gh23sdfAERtLWav2674" + #ssh_username = "packer_build" + #ssh_password = "tvowyfv9gh23sdfAERtLWav2674" + network_adapters { + model = "virtio" + bridge = "vmbr111" + } + + qemu_agent = true + scsi_controller = "virtio-scsi-pci" + + disks { + type = "scsi" + disk_size = "55G" + storage_pool = "FAST" + storage_pool_type = "lvm-thin" + format = "raw" + } + boot_wait = "5s" + boot_command = [" inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/redhat.kix"] +} + +build { + sources = [ "source.proxmox.alma" ] + + provisioner "ansible" { + pause_before = "20s" + ansible_env_vars= [ + "ANSIBLE_HOST_KEY_CHECKING=False", + "ANSIBLE_SSH_ARGS='-o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s'", + "ANSIBLE_NOCOLOR=True" + ] + extra_arguments= [ + "-e templating=true" + ] + playbook_file = "../../../Ansible/playbooks/MyLinuxServers.yaml" + } +} \ No newline at end of file