added local DVD install example

This commit is contained in:
daniel 2021-02-02 17:34:43 +01:00 committed by Daniel Koschützki
parent fb4d888419
commit 5f97c22606
2 changed files with 120 additions and 0 deletions

View File

@ -0,0 +1,73 @@
variable "remote_host" {
type = string
description = "The ip or fqdn of your XenServer. This will be pulled from the env var 'PKR_VAR_XAPI_HOST'"
sensitive = true
default = null
}
variable "remote_password" {
type = string
description = "The password used to interact with your XenServer. This will be pulled from the env var 'PKR_VAR_XAPI_PASSWORD'"
sensitive = true
default = null
}
variable "remote_username" {
type = string
description = "The username used to interact with your XenServer. This will be pulled from the env var 'PKR_VAR_XAPI_USERNAME'"
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}"
vm_description = "Build started: ${local.timestamp}\n This was installed From the dvd"
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"
shutdown_command = "/sbin/shutdown"
output_directory = "packer-centos8-local"
keep_vm = "always"
}
build {
sources = ["xenserver-iso.centos8-local"]
}

View File

@ -0,0 +1,47 @@
eula --agreed
lang en-US.UTF-8
keyboard --vckeymap='de' --xlayouts='de'
timezone Europe/Berlin
cdrom
text
skipx
firstboot --disable
rootpw --plaintext centos
firewall --enabled --ssh
selinux --enforcing
# Installation logging level
logging --level=info
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
zerombr
clearpart --all
# Disk partitioning information
part / --asprimary --fstype="ext4" --size=1024 --grow
%addon com_redhat_kdump --disable
%end
%packages --ignoremissing --excludedocs
openssh-clients
sudo
# unnecessary firmware
-aic94xx-firmware*
-alsa-*
-ivtv-*
-iwl*firmware
%end
# Reboot after installation
reboot --eject