Lots of improvements everywhere
This commit is contained in:
+20
-3
@@ -1,3 +1,20 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
qemu = {
|
||||
source = "github.com/hashicorp/qemu"
|
||||
version = "~> 1"
|
||||
}
|
||||
ansible = {
|
||||
source = "github.com/hashicorp/ansible"
|
||||
version = "~> 1"
|
||||
}
|
||||
vagrant = {
|
||||
source = "github.com/hashicorp/vagrant"
|
||||
version = "~> 1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
build {
|
||||
sources = [
|
||||
"source.qemu.x86_64",
|
||||
@@ -10,9 +27,9 @@ build {
|
||||
user = local.ssh.username
|
||||
use_sftp = true
|
||||
ansible_ssh_extra_args = [
|
||||
"-o HostKeyAlgorithms=+ssh-rsa ",
|
||||
"-o PubkeyAcceptedKeyTypes=+ssh-rsa ",
|
||||
"-o IdentitiesOnly=yes"
|
||||
#"-o", "HostKeyAlgorithms=+ssh-rsa",
|
||||
#"-o", "PubkeyAcceptedKeyTypes=+ssh-rsa",
|
||||
"-o", "IdentitiesOnly=yes"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,16 @@ variable "build" {
|
||||
default = "0.1"
|
||||
}
|
||||
|
||||
variable "cd_files" {
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "cd_label" {
|
||||
type = string
|
||||
default = "cidata"
|
||||
}
|
||||
|
||||
locals {
|
||||
name = "${var.distro}-${var.version}-${var.arch}"
|
||||
description = templatefile("../README.box.md", {
|
||||
@@ -66,5 +76,6 @@ locals {
|
||||
password = "vagrant"
|
||||
handshake_attempts = 1000
|
||||
timeout = "5h45m"
|
||||
private_key_file = "vagrant/insecure_key"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ source "qemu" "x86_64" {
|
||||
ssh_username = local.ssh.username
|
||||
ssh_password = local.ssh.password
|
||||
ssh_handshake_attempts = local.ssh.handshake_attempts
|
||||
ssh_private_key_file = local.ssh.private_key_file
|
||||
|
||||
vm_name = "packer-${local.name}"
|
||||
disk_size = "${local.disk_size}G"
|
||||
@@ -23,11 +24,15 @@ source "qemu" "x86_64" {
|
||||
headless = var.headless
|
||||
disk_cache = "writeback"
|
||||
format = "qcow2"
|
||||
cpu_model = "host"
|
||||
|
||||
qemuargs = [
|
||||
["-chardev", "stdio,id=char0,logfile=serial-output-qemu-${var.arch}-${var.distro}-${var.version},signal=off"],
|
||||
["-serial", "chardev:char0"]
|
||||
]
|
||||
http_directory = "http"
|
||||
accelerator = var.qemu_accelerator
|
||||
|
||||
http_directory = "http"
|
||||
cd_files = var.cd_files
|
||||
cd_label = var.cd_label
|
||||
}
|
||||
|
||||
@@ -18,13 +18,15 @@ source "virtualbox-iso" "x86_64" {
|
||||
cpus = local.cpus
|
||||
memory = local.memory
|
||||
headless = var.headless
|
||||
guest_os_type = "${var.distro}_64"
|
||||
guest_additions_url = "http://download.virtualbox.org/virtualbox/6.1.34/VBoxGuestAdditions_6.1.34.iso"
|
||||
guest_additions_sha256 = "88f86fa0e6970b6a7c80d714b7a91a8c425ff8ef53a3e73fc80781191a87257b"
|
||||
nic_type = "virtio"
|
||||
guest_os_type = "RedHat_64"
|
||||
guest_additions_url = "http://download.virtualbox.org/virtualbox/7.0.10/VBoxGuestAdditions_7.0.10.iso"
|
||||
guest_additions_sha256 = "bbabd89b8fff38a257bab039a278f0c4dc4426eff6e4238c1db01edb7284186a"
|
||||
vboxmanage = [
|
||||
["modifyvm", "{{ .Name }}", "--uart1", "0x3F8", "4"],
|
||||
["modifyvm", "{{ .Name }}", "--uartmode1", "file", "serial-output-virtualbox-${var.arch}-${var.distro}-${var.version}"]
|
||||
]
|
||||
|
||||
http_directory = "http"
|
||||
cd_files = [ "http/${var.cd_files_path}" ]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user