Split configs

This commit is contained in:
Serge Logvinov
2021-08-21 19:58:10 +03:00
parent aeadced9ef
commit 9bc3ce7f18
3 changed files with 57 additions and 31 deletions

View File

@@ -0,0 +1,6 @@
release:
packer build -only=release.scaleway.talos .
develop:
packer build -only=develop.scaleway.talos .

View File

@@ -8,33 +8,6 @@ packer {
}
}
variable "scaleway_project_id" {
type = string
default = "${env("SCW_DEFAULT_PROJECT_ID")}"
}
variable "scaleway_access_key" {
type = string
default = "${env("SCW_ACCESS_KEY")}"
sensitive = true
}
variable "scaleway_secret_key" {
type = string
default = "${env("SCW_SECRET_KEY")}"
sensitive = true
}
variable "scaleway_zone" {
type = string
default = "fr-par-2"
}
variable "talos_version" {
type = string
default = "v0.11.0"
}
source "scaleway" "talos" {
project_id = var.scaleway_project_id
access_key = var.scaleway_access_key
@@ -45,19 +18,35 @@ source "scaleway" "talos" {
commercial_type = "DEV1-S"
boottype = "rescue"
remove_volume = true
ssh_username = "root"
ssh_username = "root"
snapshot_name = "talos system disk"
snapshot_name = "talos system disk"
}
build {
name = "release"
sources = ["source.scaleway.talos"]
provisioner "shell" {
inline = [
"apt-get install -y wget",
"wget -O /tmp/talos.tar.gz https://github.com/talos-systems/talos/releases/download/${var.talos_version}/metal-amd64.tar.gz",
"wget -O /tmp/talos.tar.gz ${local.image}",
"tar xOzf /tmp/talos.tar.gz | dd of=/dev/vda",
]
}
}
build {
name = "develop"
sources = ["source.scaleway.talos"]
provisioner "file" {
source = "../../../talos-pr/_out/scaleway-amd64.tar.gz"
destination = "/tmp/talos.tar.gz"
}
provisioner "shell" {
inline = [
"tar xOzf /tmp/talos.tar.gz | dd of=/dev/sda && sync",
]
}
}

View File

@@ -0,0 +1,31 @@
variable "scaleway_project_id" {
type = string
default = env("SCW_DEFAULT_PROJECT_ID")
}
variable "scaleway_access_key" {
type = string
default = env("SCW_ACCESS_KEY")
sensitive = true
}
variable "scaleway_secret_key" {
type = string
default = env("SCW_SECRET_KEY")
sensitive = true
}
variable "scaleway_zone" {
type = string
default = "fr-par-2"
}
variable "talos_version" {
type = string
default = "v0.12.0"
}
locals {
image = "https://github.com/talos-systems/talos/releases/download/${var.talos_version}/metal-amd64.tar.gz"
}