minio-lxc.pkr.hcl (1545B)
1 variable "manifest" { 2 type = string 3 default = "manifest.json" 4 } 5 6 variable "minio_binary" { 7 type = string 8 default = "./minio" 9 } 10 11 variable "minio_volumes" { 12 type = string 13 default = "/mnt/data" 14 } 15 16 variable "minio_opts" { 17 type = string 18 default = "--console-address :9001" 19 } 20 21 variable "minio_service_user" { 22 type = string 23 default = "minio-user" 24 } 25 26 variable "minio_service_group" { 27 type = string 28 default = "minio-user" 29 } 30 31 variable "minio_root_user" { 32 type = string 33 default = "root" 34 } 35 36 variable "minio_root_password" { 37 type = string 38 sensitive = true 39 } 40 41 source "lxc" "minio" { 42 config_file = "config/lxc-config" 43 template_name = "download" 44 template_parameters = ["--dist", "Debian_by_maurer", "--release", "Bookworm", "--arch", "armv7l"] 45 } 46 47 build { 48 sources = ["source.lxc.minio"] 49 50 provisioner "shell" { 51 script = "scripts/timezone.sh" 52 } 53 54 provisioner "file" { 55 source = "${var.minio_binary}" 56 destination = "/usr/local/bin/minio" 57 } 58 59 provisioner "shell" { 60 environment_vars = [ 61 "MINIO_ROOT_USER=${var.minio_root_user}", 62 "MINIO_ROOT_PASSWORD=${var.minio_root_password}", 63 "MINIO_VOLUMES=${var.minio_volumes}", 64 "MINIO_OPTS=${var.minio_opts}", 65 "MINIO_SERVICE_USER=${var.minio_service_user}", 66 "MINIO_SERVICE_GROUP=${var.minio_service_group}" 67 ] 68 script = "scripts/minio.sh" 69 } 70 71 } 72 73 packer { 74 required_plugins { 75 lxc = { 76 version = ">= 1.0.2" 77 source = "github.com/hashicorp/lxc" 78 } 79 } 80 }