A repo is where you store all of the actual bits used by Razor to install a node. Or, in some cases, the external location of bits that you link to. A repo is identified by a unique name, such as centos-6.7. Instructions for the installation, such as what should be installed, where to get it, and how to configure it, are contained in tasks, which are described below.
To load a repo onto the server, use the command,
razor create-repo --name=<repo name> --task <task name> --iso-url <URL>
For example:
razor create-repo --name centos-6.7 --task centos
--iso-url http://centos.sonn.com/6.7/isos/x86_64/CentOS-6.7-x86_64-bin-DVD1.iso
There are three types of repositories that you might want to use, all
created with the create-repo
command:
The task
parameter is mandatory for creating all three of these types of
repositories, and indicates the default installer to use with this
repo. You can override a task
parameter at the policy level. If you’re
not using a task, reference the stock task noop
.
This repo is created with the --iso-url
property. The server downloads and
unpacks the ISO image onto its file system:
razor create-repo --name centos-6.7 --task centos
--iso-url http://centos.sonn.com/6.7/isos/x86_64/CentOS-6.7-x86_64-bin-DVD1.iso
To make a repo that points to an existing resource without loading anything
onto the Razor server, provide a url
property when you create the
repository. The url
should be serving the unpacked contents of the
install media.
razor create-repo --name centos-6.7 --task centos
--url http://mirror.example.org/centos/6.7/
For some install media, especially Windows install DVDs, Razor is not able to automatically unpack the media; this is a known limtation of the library that Razor uses to unpack ISO images.
In those cases, it is necessary to first use create-repo
to set up a stub
directory on the Razor server, then manually add content to it. The
stub directory is created with the following:
razor create-repo --name win2012r2 --task windows/2012r2 \
--no-content true
When this command completes successfully, log into your Razor server as root and cd into your server’s repository directory. The repository directory is specified by the repo_store_root
class parameter of the pe_razor
class. By default, the directory is /opt/puppetlabs/server/data/razor_server/repo
.
Run the following:
# mount -o loop /path/to/windows_server_2012_r2.iso /mnt
# cp -pr /mnt/* win2012r2
# umount /mnt
Related links: