github.com/hashicorp/packer@v1.14.3/website/content/partials/packer-plugin-sdk/multistep/commonsteps/CDConfig-not-required.mdx (about) 1 <!-- Code generated from the comments of the CDConfig struct in multistep/commonsteps/extra_iso_config.go; DO NOT EDIT MANUALLY --> 2 3 - `cd_files` ([]string) - A list of files to place onto a CD that is attached when the VM is 4 booted. This can include either files or directories; any directories 5 will be copied onto the CD recursively, preserving directory structure 6 hierarchy. Symlinks will have the link's target copied into the directory 7 tree on the CD where the symlink was. File globbing is allowed. 8 9 Usage example (JSON): 10 11 ```json 12 "cd_files": ["./somedirectory/meta-data", "./somedirectory/user-data"], 13 "cd_label": "cidata", 14 ``` 15 16 Usage example (HCL): 17 18 ```hcl 19 cd_files = ["./somedirectory/meta-data", "./somedirectory/user-data"] 20 cd_label = "cidata" 21 ``` 22 23 The above will create a CD with two files, user-data and meta-data in the 24 CD root. This specific example is how you would create a CD that can be 25 used for an Ubuntu 20.04 autoinstall. 26 27 Since globbing is also supported, 28 29 ```hcl 30 cd_files = ["./somedirectory/*"] 31 cd_label = "cidata" 32 ``` 33 34 Would also be an acceptable way to define the above cd. The difference 35 between providing the directory with or without the glob is whether the 36 directory itself or its contents will be at the CD root. 37 38 Use of this option assumes that you have a command line tool installed 39 that can handle the iso creation. Packer will use one of the following 40 tools: 41 42 * xorriso 43 * mkisofs 44 * hdiutil (normally found in macOS) 45 * oscdimg (normally found in Windows as part of the Windows ADK) 46 47 - `cd_content` (map[string]string) - Key/Values to add to the CD. The keys represent the paths, and the values 48 contents. It can be used alongside `cd_files`, which is useful to add large 49 files without loading them into memory. If any paths are specified by both, 50 the contents in `cd_content` will take precedence. 51 52 Usage example (HCL): 53 54 ```hcl 55 cd_files = ["vendor-data"] 56 cd_content = { 57 "meta-data" = jsonencode(local.instance_data) 58 "user-data" = templatefile("user-data", { packages = ["nginx"] }) 59 } 60 cd_label = "cidata" 61 ``` 62 63 - `cd_label` (string) - CD Label 64 65 <!-- End of code generated from the comments of the CDConfig struct in multistep/commonsteps/extra_iso_config.go; -->