Files
skz-opack/src/defines.mk

158 lines
4.6 KiB
Makefile

define newline
endef
define OPACK_INSTALL_CONTENT =
Choose your keyboard layout = fr
System hostname = $(OPACK_SYS_HOSTNAME)-$(OPACK_TARGET)
Which network interface = vio0
IPv4 address for vio0 = dhcp
IPv6 address for vio0 = none
Password for root account = $(OPACK_SYS_PASSWORD)
Public ssh key for root account = $(OPACK_SYS_SSH_KEY)
Allow root ssh login = prohibit-password
Do you expect to run the X Window System = $(OPACK_SYS_XENOCARA)
Setup a user = $(OPACK_SYS_USER)
Password for user $(OPACK_SYS_USER) = $(OPACK_SYS_PASSWORD)
Public ssh key for $(OPACK_SYS_USER) = $(OPACK_SYS_SSH_KEY)
Allow root ssh login = prohibit-password
What timezone = $(OPACK_SYS_TIMEZONE)
Which disk = sd0
Use (W)hole disk or (E)dit the MBR = whole
URL to autopartitioning template for disklabel = file:/autodisklabel
Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout = A
Location of sets = $(OPACK_SYS_SETS_LOCATION)
HTTP Server = $(OPACK_SYS_SERVER)
Server directory = pub/OpenBSD/$(OPACK_SYS_VERSION)/$(OPACK_SYS_ARCHITECTURE)
Unable to connect using https. Use http instead = yes
Pathname to the sets = $(OPACK_SYS_VERSION_MAJOR).$(OPACK_SYS_VERSION_MINOR)/amd64
Set name(s) = $(OPACK_SYS_SETS) done
Directory does not contain SHA256.sig. Continue without verification = $(OPACK_NO_SIGCHK)
Signature check of SHA256.sig failed. Continue without verification = no
Cannot determine prefetch area. Continue without verification = yes
Location of sets? = done
endef
define OPACK_INSTALL_CLOUD_CONTENT =
Choose your keyboard layout = fr
System hostname = $(OPACK_SYS_HOSTNAME)
Which network interface = vio0
IPv4 address for vio0 = dhcp
IPv6 address for vio0 = none
Password for root account = $(OPACK_SYS_PASSWORD)
Public ssh key for root account = $(OPACK_SYS_SSH_PUBLIC_KEY)
Allow root ssh login = prohibit-password
Do you expect to run the X Window System = $(OPACK_SYS_XENOCARA)
Setup a user = $(OPACK_SYS_USER)
Password for user $(OPACK_SYS_USER) = $(OPACK_SYS_PASSWORD)
Public ssh key for $(OPACK_SYS_USER) = $(OPACK_SYS_SSH_PUBLIC_KEY)
Allow root ssh login = prohibit-password
What timezone = $(OPACK_SYS_TIMEZONE)
Which disk = sd0
Use (W)hole disk or (E)dit the MBR = whole
URL to autopartitioning template for disklabel = file:/autodisklabel
Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout = A
Location of sets = $(OPACK_SYS_SETS_LOCATION)
HTTP Server = $(OPACK_SYS_SERVER)
Server directory = pub/OpenBSD/$(OPACK_SYS_VERSION)/$(OPACK_SYS_ARCHITECTURE)
Unable to connect using https. Use http instead = yes
Pathname to the sets = $(OPACK_SYS_VERSION_MAJOR).$(OPACK_SYS_VERSION_MINOR)/amd64
Set name(s) = $(OPACK_SYS_SETS) done
Directory does not contain SHA256.sig. Continue without verification = $(OPACK_NO_SIGCHK)
Signature check of SHA256.sig failed. Continue without verification = no
Cannot determine prefetch area. Continue without verification = yes
Location of sets? = done
endef
define OPACK_METADATA_CONTENT =
{
"name": "$(OPACK_BOX_TAG)",
"description": "OPACK - $(OPACK_COMMIT)",
"versions": [
{
"version": "$(OPACK_BOX_VERSION)",
"providers": [
{
"name": "libvirt",
"url": "$(OPACK_BOX_FILE)",
"checksum_type": "sha256",
"checksum": "$(OPACK_BOX_FILE_SHA256)"
}
]
}
]
}
endef
define OPACK_TERRAFORM_CONTENT =
variable "credentials" { default = "../$(OPACK_GCE_JSON_KEY)" }
variable "project" { default = "$(OPACK_GCE_PROJECT)" }
variable "region" { default = "$(OPACK_GCE_REGION)" }
variable "zone" { default = "$(OPACK_GCE_ZONE)" }
provider "google" {
region = "$${var.region}"
credentials = "$${var.credentials}"
project = "$${var.project}"
}
module "opack-module" {
source = "./opack-module"
gce_zone = "$${var.zone}"
servers = 1
}
output "ip" {
value = module.opack-module.nat_ip
}
endef
define OPACK_TERRAFORM_MODULE_CONTENT =
variable "servers" {}
variable "gce_zone" {}
resource "google_compute_instance" "$(OPACK_TARGET)" {
tags = ["skz-opack", "default"]
name = "$(OPACK_TARGET)"
machine_type = "$(OPACK_GCE_MACHINE)"
zone = "$${var.gce_zone}"
boot_disk {
initialize_params {
image = "openbsd"
}
}
network_interface {
network = "default"
access_config {
// Ephemeral IP
}
}
scheduling {
preemptible = false
on_host_maintenance = "MIGRATE"
automatic_restart = true
}
}
output "nat_ip" {
value = google_compute_instance.$(OPACK_TARGET)[*].network_interface[0].access_config[0].nat_ip
}
endef
define OPACK_TERRAFORM_IMPORT_CONTENT =
resource "google_compute_image" "$(OPACK_TARGET)" {
# name = "$(OPACK_TARGET)"
}
endef