Skip to content

static-lookaside

Should the machine use dynamic virtual media attached isos to boot

By default, dr-provision expects to be able to serve static files from a few different places in this order:

  • A dynamically rendered template file that has registered to be served from a particular path
  • A subdirectory that has been redirected to a remote server via the package-repositories parameter.
  • A different file pointed to by a template Link field.
  • A plain old local static file or directory

This parameter provides an additional customizable way transparently redirect to a remote HTTP server based on either boot environment name or directory path. It consists of a map of local resource: remote resource pairs that abide by the following rules:

  • If the local part begins with a /, it will be interpreted as a local directory starting at the static file server root. It will not be possible to escape from the static file server.
  • If the local part is exactly /, it is a general purpose override to refer all static file access to the corresponding remote resource, and the remote resource must start with http:// or https:// Be aware, the remote resource must have a copy of all the files dr-provision requires, and any local changes made by uploading files and isos will not be visible.
  • If the local resource does not begin with a /, it will be interpreted as if it was the name of a boot environment, and it will expand to the install paths using the same rules as {{ .Env.PathFor "tftp" }}. If the boot environment is not defined, it will be skipped. By default, this will only create a lookaside that is valid for the amd64 architecture. To specify lookasides for alternate architectures, name the local resource as bootenv-name/arch
  • If the remote resource begins with http:// or https://, then that URL will be used as the base URL for the lookaside. Otherwise, it will be appended to the remote resource of the '/' local redirect and that constructed URL will be used as the base URL for the lookaside.
  • It is not permitted to have a remote resource that does not begin with http:// or https:// without a local / resource.

Example:

::

{
  "/bob/modium": "https://mirrors.edge.kernel.org/centos",
  "centos-7-install": "https://mirrors.edge.kernel.org/centos/7/os/x86_64/",
  "centos-7-install/arm64": "http://mirror.centos.org/altarch/7/os/aarch64/"
}

This directs dr-provision to transparently proxy any request on the static file server for /bob/modium (and any r esources under it) to https://mirrors.edge.kernel.org/centos, any requests for /centos-7/install/ to https://mirrors.edge.kernel.org/centos/7/os/x86_64/, and any requests to /centos-7/arm64/install to http://mirror.centos.org/altarch/7/os/aarch64/, assuming your centos-7-install boot environment comes from drp-community-content.

Redirects for Ubuntu installs should point to exploded Ubuntu install ISO files instead of package repository mirrors, as there are significant differences in the directory layout between the two from a a network boot and install perspecitve.

This functionality works for tftp requests and requests on port 8091, and dr-provision does not attempt to perform any request caching.