first
This commit is contained in:
58
src/packerfile.mk
Normal file
58
src/packerfile.mk
Normal file
@@ -0,0 +1,58 @@
|
||||
define OPACK_PACKER_CONTENT =
|
||||
{
|
||||
"description": "OpenBSD $(OPACK_SYS_VERSION) $(OPACK_SYS_ARCHITECTURE)",
|
||||
"variables": {
|
||||
"box_tag": "$(OPACK_SYS_HOSTNAME)-$(OPACK_TARGET)-{{ timestamp }}",
|
||||
"disk_size": "$(OPACK_SYS_DISK_SIZE)",
|
||||
"memory": "$(OPACK_SYS_MEMORY)",
|
||||
"cpus": "$(OPACK_SYS_CPU)",
|
||||
"version": "$(OPACK_BOX_VERSION)" },
|
||||
"builders": [ {
|
||||
"type": "qemu",
|
||||
"vm_name": "$(OPACK_SYS_HOSTNAME)-$(OPACK_TARGET)",
|
||||
"cpus": "{{user `cpus`}}",
|
||||
"memory": "{{user `memory`}}",
|
||||
"headless": $(OPACK_SYS_HEADLESS),
|
||||
"boot_key_interval": "10ms",
|
||||
"disk_size": "{{user `disk_size`}}",
|
||||
"disk_interface": "virtio",
|
||||
"disk_compression": true,
|
||||
"http_directory": "./http",
|
||||
"iso_urls": "$(OPACK_SYS_ISO_URL)",
|
||||
"iso_checksum": "sha256:$(OPACK_SYS_ISO_SHA256SUM)",
|
||||
"net_device": "virtio-net",
|
||||
"communicator": "ssh",
|
||||
"ssh_username": "root",
|
||||
"ssh_private_key_file": "vagrant.key",
|
||||
"ssh_wait_timeout": "60m",
|
||||
"shutdown_command": "shutdown -p now",
|
||||
"boot_wait": "30s",
|
||||
"boot_command": [ "S<enter><wait>",
|
||||
"# ~~~ OPACK - OpenBSD Packing ~~~~<enter>",
|
||||
"# $(OPACK_COMMIT) <enter>",
|
||||
"ifconfig vio0 inet autoconf & ",
|
||||
"sleep 1 && ",
|
||||
"wait && ",
|
||||
"ftp http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.conf && ",
|
||||
"ftp http://{{ .HTTPIP }}:{{ .HTTPPort }}/autodisklabel && ",
|
||||
"install -af install.conf && ",
|
||||
"echo permit nopass :wheel > /mnt/etc/doas.conf && ",
|
||||
"echo inet autoconf > /mnt/etc/hostname.vio0 && ",
|
||||
"echo PubkeyAcceptedAlgorithms +ssh-rsa >> /mnt/etc/ssh/sshd_config && ",
|
||||
"reboot<enter>" ]
|
||||
} ],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "shell",
|
||||
"scripts": ["$(OPACK_PROVISION_FILE)"]
|
||||
}
|
||||
],
|
||||
"post-processors": [ [
|
||||
{ "name": "vagrant",
|
||||
"type": "vagrant",
|
||||
"compression_level": 9,
|
||||
"output": "$(OPACK_BOX_FILE)" }
|
||||
] ]
|
||||
}
|
||||
endef
|
||||
|
||||
Reference in New Issue
Block a user