github.com/hashicorp/packer@v1.14.3/examples/hcl/linux/variables.common.pkr.hcl (about)

     1  
     2  variable "preseed_path" {
     3    type    = string
     4    default = "preseed.cfg"
     5  }
     6  
     7  variable "guest_additions_url" {
     8    type    = string
     9    default = ""
    10  }
    11  
    12  variable "headless" {
    13    type    = bool
    14    default = true
    15  }
    16  
    17  locals {
    18    // fileset lists all files in the http directory as a set, we convert that
    19    // set to a list of strings and we then take the directory of the first
    20    // value. This validates that the http directory exists even before starting
    21    // any builder/provisioner.
    22    http_directory = dirname(convert(fileset(".", "etc/http/*"), list(string))[0])
    23    http_directory_content = {
    24      "/alpine-answers"           = file("${local.http_directory}/alpine-answers"),
    25      "/alpine-setup.sh"          = file("${local.http_directory}/alpine-setup.sh"),
    26      "/preseed_hardcoded_ip.cfg" = file("${local.http_directory}/preseed_hardcoded_ip.cfg"),
    27      "/preseed.cfg"              = file("${local.http_directory}/preseed.cfg"),
    28    }
    29  }