Creating and using a local repository v23
If you create a local repository within your cluster directory, TPA will make any packages in the repository available to cluster instances. This is an easy way to ship extra packages to your cluster.
Optionally, you can also instruct TPA to configure the instances to use only this repository, i.e., disable all others. In this case, you must provide all packages required during the deployment, starting from basic dependencies like rsync, Python, and so on.
You can create a local repository manually, or have TPA create one for you. Instructions for both are included below.
Specific instructions are available for managing clusters in an air-gapped environment.
TPA includes tools to help create such a local repository. Specifically
--enable-local-repo switch can be used with
tpaexec configure to
create an empty directory structure to be used as a local repository,
tpaexec download-packages populates that structure with the
To configure a cluster with a local repository, run:
This will generate your cluster configuration and create a
directory and OS-specific subdirectories. See below for details of the
tpaexec download-packages to
download all the packages required by a cluster into the local-repo.
The resulting repository will contain the full dependency tree of all
packages so the entire cluster can be installed from this repository.
Metadata for the repository will also be created automatically meaning
it is ready to use immediately.
To create a local repository manually, you must first create an
appropriate directory structure. When using
TPA will create a
local-repo directory and OS-specific
subdirectories within it (e.g.,
local-repo/Debian/10), based on the OS
you select for the cluster. We recommend that this structure is also
used for manually created repositories.
For example, a cluster running RedHat 8 might have the following layout:
For each instance, TPA will look for the following subdirectories of
local-repo in order and use the first one it finds:
<distribution>/<major version>, e.g.,
<distribution>/<release name>, e.g.,
If none of these directories exists, of course, TPA will not try to set up any local repository on target instances.
The steps detailed below must be completed before running
To populate the repository, copy the packages you wish to include into the appropriate directory. Then generate metadata using the correct tool for your system as detailed below.
You must generate the metadata on the control node, i.e., the machine where you run tpaexec. TPA will copy the metadata and packages to target instances.
You must generate the metadata in the subdirectory that the instance
will use, i.e., if you copy packages into
must create the metadata in that directory, not in
For Debian-based distributions, install the
Now you can use
dpkg-scanpackages to generate the metadata:
First, install the
Now you can use
createrepo to generate the metadata:
TPA will use rsync to copy the contents of the repository directory, including the generated metadata, to a directory on target instances.
If rsync is not already available on an instance, TPA can install it
apt-get install rsync or
yum install rsync). However, if you
use_local_repo_only, the rsync package must be included in
the local repo. If required, TPA will copy just the rsync package
using scp and install it before copying the rest.
After copying the contents of the local repo to target instances, TPA will configure the destination directory as a local (i.e., path-based, rather than URL-based) repository.
If you provide, say,
example.deb in the repository
apt-get install example will suffice to install it,
just like any package in any other repository.
TPA configures a repository with the contents that you provide, but if the same package is available from different repositories, it is up to the package manager to decide which one to install (usually the latest, unless you specify a particular version).
(However, if you set
use_local_repo_only: yes, TPA will disable
all other package repositories, so that instances can only use the
packages that you provide in