packer-plugin-xenserver/examples
2021-04-15 18:04:44 +02:00
..
centos Added a commented example of a centos8 build 2021-04-15 18:04:39 +02:00
http removed centos8 json example and kickstart 2021-04-15 18:03:55 +02:00
ubuntu Update the Ubuntu example to hcl and packer init 2021-04-15 18:04:00 +02:00
centos8.json removed centos8 json example and kickstart 2021-04-15 18:04:44 +02:00
README.md Removed the ubuntu specific section from examples/readme 2021-04-15 18:04:44 +02:00
ubuntu-2004.json Update the Ubuntu example to hcl and packer init 2021-04-15 18:04:00 +02:00

Examples

In order for new users to get up and running with the packer builder, a few examples of building a machine image with popular distros have been created.

In order to see an exhaustive list of configuration options for the packer builder please see the following documentation. This doc will focus on the details relevant to the particular distro.

Running the examples

In order to run the examples you will need to perform the following steps:

  1. Export those vars:
PKR_VAR_remote_host
PKR_VAR_remote_password
PKR_VAR_remote_username
PKR_VAR_sr_name
PKR_VAR_sr_iso_name

PKR_VAR_remote_host must be the resource pool primary, aka the master.

  1. Run packer init path/to/defenition.pkr.hcl to download the xenserver plugin

  2. Run packer build path/to/defenition.pkr.hcl
    so for example: packer build examples/centos/centos8-netinstall.pkr.hcl

Ubuntu

The Ubuntu example uses the autoinstall tool to configure the VM template. Please see the autoinstall docs for an exhaustive list of what is supported.

Packer will create a http server to serve the files as specified from the http_directory specified in the builder configuration. This is where the user-data and meta-data for autoinstall must be present.

Centos

The Centos examples use kickstart files to configure the VM template. Please see the kickstart documentation for the options that are supported.

Packer will create a http server to serve the files as specified from the http_directory specified in the builder configuration. This is where the kickstart config file must be present.