Spread build source defs more evenly
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
build {
|
||||||
|
sources = ["source.qemu.x86_64"]
|
||||||
|
|
||||||
|
provisioner "ansible" {
|
||||||
|
playbook_file = "ansible/playbook.yml"
|
||||||
|
galaxy_file = "ansible/requirements.yml"
|
||||||
|
}
|
||||||
|
|
||||||
|
provisioner "shell" {
|
||||||
|
scripts = [
|
||||||
|
"scripts/minimize.sh"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
post-processors {
|
||||||
|
post-processor "vagrant" {
|
||||||
|
keep_input_artifact = true
|
||||||
|
compression_level = 9
|
||||||
|
output = "${local.name}.box"
|
||||||
|
vagrantfile_template = "vagrant/${var.arch}.rb"
|
||||||
|
}
|
||||||
|
|
||||||
|
post-processor "vagrant-cloud" {
|
||||||
|
name = "upload"
|
||||||
|
box_tag = "greg-hellings/${local.name}"
|
||||||
|
version = local.build
|
||||||
|
version_description = local.description
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
variable "iso" {
|
||||||
|
type = map(string)
|
||||||
|
description = "A map containing the URL and checksum for the ISO file"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "distro" {
|
||||||
|
type = string
|
||||||
|
default = "unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "arch" {
|
||||||
|
type = string
|
||||||
|
default = "x86_64"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "version" {
|
||||||
|
type = string
|
||||||
|
description = "The distro version being specified"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "boot_wait" {
|
||||||
|
type = string
|
||||||
|
default = "20s"
|
||||||
|
description = "Length of time to wait before entering boot commands"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "ssh" {
|
||||||
|
type = map(string)
|
||||||
|
default = {
|
||||||
|
username = "vagrant"
|
||||||
|
password = "vagrant"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "boot_command" {
|
||||||
|
type = list(string)
|
||||||
|
default = []
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "ssh_handshake_attempts" {
|
||||||
|
type = number
|
||||||
|
default = 100
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "shutdown_command" {
|
||||||
|
type = string
|
||||||
|
default = "sudo systemctl poweroff"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "disk_size" {
|
||||||
|
type = string
|
||||||
|
default = "20G"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "headless" {
|
||||||
|
type = bool
|
||||||
|
default = true
|
||||||
|
}
|
||||||
|
|
||||||
|
locals {
|
||||||
|
name = "${var.distro}-${var.version}-${var.arch}"
|
||||||
|
build = formatdate("YYYYMMDDhh", timestamp())
|
||||||
|
description = templatefile("../README.box.md", {
|
||||||
|
distro = var.distro
|
||||||
|
arch = var.arch
|
||||||
|
version = var.version
|
||||||
|
build = local.build
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,73 +1,3 @@
|
|||||||
variable "iso" {
|
|
||||||
type = map(string)
|
|
||||||
description = "A map containing the URL and checksum for the ISO file"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "distro" {
|
|
||||||
type = string
|
|
||||||
default = "unknown"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "arch" {
|
|
||||||
type = string
|
|
||||||
default = "x86_64"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "version" {
|
|
||||||
type = string
|
|
||||||
description = "The distro version being specified"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "boot_wait" {
|
|
||||||
type = string
|
|
||||||
default = "20s"
|
|
||||||
description = "Length of time to wait before entering boot commands"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "ssh" {
|
|
||||||
type = map(string)
|
|
||||||
default = {
|
|
||||||
username = "vagrant"
|
|
||||||
password = "vagrant"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "boot_command" {
|
|
||||||
type = list(string)
|
|
||||||
default = []
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "ssh_handshake_attempts" {
|
|
||||||
type = number
|
|
||||||
default = 100
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "shutdown_command" {
|
|
||||||
type = string
|
|
||||||
default = "sudo systemctl poweroff"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "disk_size" {
|
|
||||||
type = string
|
|
||||||
default = "20G"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "headless" {
|
|
||||||
type = bool
|
|
||||||
default = true
|
|
||||||
}
|
|
||||||
|
|
||||||
locals {
|
|
||||||
name = "${var.distro}-${var.version}-${var.arch}"
|
|
||||||
build = formatdate("YYYYMMDDhh", timestamp())
|
|
||||||
description = templatefile("../README.box.md", {
|
|
||||||
distro = var.distro
|
|
||||||
arch = var.arch
|
|
||||||
version = var.version
|
|
||||||
build = local.build
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
source "qemu" "x86_64" {
|
source "qemu" "x86_64" {
|
||||||
iso_url = var.iso.url
|
iso_url = var.iso.url
|
||||||
iso_checksum = var.iso.checksum
|
iso_checksum = var.iso.checksum
|
||||||
@@ -88,34 +18,3 @@ source "qemu" "x86_64" {
|
|||||||
qemuargs = [["-serial", "stdio"]]
|
qemuargs = [["-serial", "stdio"]]
|
||||||
shutdown_command = var.shutdown_command
|
shutdown_command = var.shutdown_command
|
||||||
}
|
}
|
||||||
|
|
||||||
build {
|
|
||||||
sources = ["source.qemu.x86_64"]
|
|
||||||
|
|
||||||
provisioner "ansible" {
|
|
||||||
playbook_file = "ansible/playbook.yml"
|
|
||||||
galaxy_file = "ansible/requirements.yml"
|
|
||||||
}
|
|
||||||
|
|
||||||
provisioner "shell" {
|
|
||||||
scripts = [
|
|
||||||
"scripts/minimize.sh"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
post-processors {
|
|
||||||
post-processor "vagrant" {
|
|
||||||
keep_input_artifact = true
|
|
||||||
compression_level = 9
|
|
||||||
output = "${local.name}.box"
|
|
||||||
vagrantfile_template = "vagrant/${var.arch}.rb"
|
|
||||||
}
|
|
||||||
|
|
||||||
post-processor "vagrant-cloud" {
|
|
||||||
name = "upload"
|
|
||||||
box_tag = "greg-hellings/${local.name}"
|
|
||||||
version = local.build
|
|
||||||
version_description = local.description
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ set -exo pipefail
|
|||||||
|
|
||||||
build="${1}"
|
build="${1}"
|
||||||
|
|
||||||
packer build -var headless=false -var-file distros/${build}.pkrvars.hcl -except=upload sources/qemu.pkr.hcl
|
packer build -var headless=false -var-file distros/${build}.pkrvars.hcl -except=upload sources/
|
||||||
vagrant box add -f --name test ${build}.box
|
vagrant box add -f --name test ${build}.box
|
||||||
vagrant up
|
vagrant up
|
||||||
vagrant ssh -c "ls -la ~/"
|
vagrant ssh -c "ls -la ~/"
|
||||||
|
|||||||
Reference in New Issue
Block a user