Skip to main content
Skip table of contents

Customize your Image YAML or Manifest File

DKP provides default YAML files for each Infrastructure Provider and their supported Operating Systems. Those default YAML files can easily be modified by replacing values. The simplest way is to open the default YAML for your OS in an editor and change a line. For example, in the following YAML, you can name a specific image rather than accepting the default source_ami: ""

AWS Example: # Example images/ami/rhel-86.yaml

CODE
---
# Example images/ami/rhel-86.yaml 
download_images: true

packer:
  ami_filter_name: "RHEL-8.6.0_HVM-*"
  ami_filter_owners: "309956199498"
  distribution: "RHEL"
  distribution_version: "8.6"
  source_ami: ""
  ssh_username: "ec2-user"
  root_device_name: "/dev/sda1"
  volume_size: "15"

build_name: "rhel-8.6"
packer_builder_type: "amazon"
python_path: ""

Once the YAML for the image is edited, you then create your image using the customized YAML by applying it in the command.

CODE
konvoy-image build aws images/ami/rhel-86.yaml

Generate a Packer File to Customize

Another method for customization is to edit your Packer template. When first running the Konvoy Image Builder(KIB) command to generate an image, it will automatically create the files needed for you to edit in a path called work folder.

First you will build an image and then you will edit the generated output to use in customizing another image. During the attempt to build the image, a packer.pkr.hcl is generated under the path work/centos-7-xxxxxxx-yyyyy/packer.pkr.hcl.

  1. Run the image creation command:

    CODE
    konvoy-image build aws images/ami/ubuntu-2004.yaml
Overrides for FIPS

You can also use FIPS overrides during initial image creation:

CODE
konvoy-image build aws images/ami/ubuntu-2004.yaml --overrides overrides/fips.yaml

To avoid fully creating the image and reduce image charges, interrupt the command right after running it. This will still generate the needed files but avoid a full image creation charge.

  1. A work file is generated (EX: work/ubuntu-20-3486702485-iulvY) which contains the files to be opened in an editor and the values added or changed:

    1. ansible_vars.yaml

    2. packer_vars.json

    3. packer.pkr.hcl

  2. Open the packer.pkr.hcl file with an editor and change the values desired.

  3. Save and rename these changes as manifest.pkr.kcl so that it can be applied during image creation using the --packer-manifest flag.

For a full list of KIB flags, run the command: konvoy-image build aws --help

  1. Once the YAML for the image is edited, you then create another image using your customized YAML by applying it with the flag --packer-manifest. Provision the new image applying the recently edited and renamed manifest.pkr.kcl:

    AWS example:

    CODE
    konvoy-image build aws --packer-manifest manifest.pkr.hcl --overrides overrides/fips.yaml
  2. Check final image for correct variables applied.

Next Topic

Customize Packer Configuration

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.