2021-04-14 04:04:38 -05:00
|
|
|
packer {
|
|
|
|
required_plugins {
|
|
|
|
xenserver= {
|
2021-04-16 04:51:09 -05:00
|
|
|
version = ">= v0.3.2"
|
2021-04-14 04:04:38 -05:00
|
|
|
source = "github.com/ddelnano/xenserver"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-02 10:34:43 -06:00
|
|
|
variable "remote_host" {
|
|
|
|
type = string
|
2021-04-22 04:48:42 -05:00
|
|
|
description = "The ip or fqdn of your XenServer. This will be pulled from the env var 'PKR_VAR_remote_host'"
|
2021-02-02 10:34:43 -06:00
|
|
|
sensitive = true
|
|
|
|
default = null
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "remote_password" {
|
|
|
|
type = string
|
2021-04-22 04:48:42 -05:00
|
|
|
description = "The password used to interact with your XenServer. This will be pulled from the env var 'PKR_VAR_remote_password'"
|
2021-02-02 10:34:43 -06:00
|
|
|
sensitive = true
|
|
|
|
default = null
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "remote_username" {
|
|
|
|
type = string
|
2021-04-22 04:48:42 -05:00
|
|
|
description = "The username used to interact with your XenServer. This will be pulled from the env var 'PKR_VAR_remote_username'"
|
2021-02-02 10:34:43 -06:00
|
|
|
sensitive = true
|
|
|
|
default = null
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "sr_iso_name" {
|
|
|
|
type = string
|
|
|
|
default = ""
|
|
|
|
description = "The ISO-SR to packer will use"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "sr_name" {
|
|
|
|
type = string
|
|
|
|
default = ""
|
|
|
|
description = "The name of the SR to packer will use"
|
|
|
|
}
|
|
|
|
|
|
|
|
locals {
|
|
|
|
timestamp = regex_replace(timestamp(), "[- TZ:]", "")
|
|
|
|
}
|
|
|
|
|
|
|
|
source "xenserver-iso" "centos8-local" {
|
|
|
|
iso_checksum = "aaf9d4b3071c16dbbda01dfe06085e5d0fdac76df323e3bbe87cce4318052247"
|
|
|
|
iso_checksum_type = "sha1"
|
|
|
|
iso_url = "http://mirrors.ocf.berkeley.edu/centos/8.3.2011/isos/x86_64/CentOS-8.3.2011-x86_64-dvd1.iso"
|
|
|
|
|
|
|
|
sr_iso_name = var.sr_iso_name
|
|
|
|
sr_name = var.sr_name
|
|
|
|
tools_iso_name = "guest-tools.iso"
|
|
|
|
|
|
|
|
remote_host = var.remote_host
|
|
|
|
remote_password = var.remote_password
|
|
|
|
remote_username = var.remote_username
|
|
|
|
|
|
|
|
vm_name = "packer-centos8-local-${local.timestamp}"
|
2021-04-14 04:04:38 -05:00
|
|
|
vm_description = "Build started: ${local.timestamp}\n This was installed from the dvd"
|
2021-02-02 10:34:43 -06:00
|
|
|
vm_memory = 4096
|
|
|
|
disk_size = 4096
|
|
|
|
|
|
|
|
http_directory = "examples/http/centos8"
|
|
|
|
boot_command = ["<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks-centos8-local.cfg<enter><wait>"]
|
|
|
|
boot_wait = "10s"
|
|
|
|
|
|
|
|
ssh_username = "root"
|
|
|
|
ssh_password = "centos"
|
|
|
|
ssh_wait_timeout = "10000s"
|
|
|
|
|
|
|
|
output_directory = "packer-centos8-local"
|
|
|
|
keep_vm = "always"
|
|
|
|
}
|
|
|
|
|
|
|
|
build {
|
|
|
|
sources = ["xenserver-iso.centos8-local"]
|
2021-02-02 10:34:43 -06:00
|
|
|
}
|