This HOWTO describes how to create Puppet :term:`control repositories <Control Repository>` for use with a :ref:`Control Repository deployment scenario <ug-sa-env-deployment-scenarios--controlrepo>`.
Contents
To use any of the procedures in this section, you must:
- Have access to a remotely-hosted :term:`Git` repository where you will host your control repository.
- Have a basic understanding of:
- Puppet :term:`Control Repositories <Control Repository>`.
- How to use the
git
command. - The topics covered in ":ref:`Deploying SIMP Environments`," particularly:
- The composition of :ref:`ug-sa-simp-environments`
- The :ref:`Local Deployment Scenario <ug-sa-env-deployment-scenarios--local>`
- The
simp
commands needed to manage a :term:`SIMP Omni-Environment`
You may find it helpful to read the section that explains how a control repository works in Puppet, Inc.'s control repository documentation .
This procedure creates an r10k control repository from a fresh SIMP ISO/RPM installation. It is currently limited to just the control repository—the RPM-provided Puppet module git repositories will remain on the SIMP server's local filesystem.
Important
This procedure does NOT describe how to migrate or host SIMP Puppet modules in remote git Repositories, or how to update the Puppetfile.simp file to deploy them.
Prerequisites
- You have installed SIMP (per the installation guide) from :ref:`ISO <gsg-installing_simp_from_an_iso>` or :ref:`RPM Repository <gsg-installing_simp_from_a_repository>`.
- This procedure needs to be done on the SIMP server.
Procedure
Create a git repository inside the
production
Puppet environment directory:cd /etc/puppetlabs/code/environments/production git init .
Create a new branch for the
production
Puppet environment:git checkout -b production
Add files to the git repository. (Do not add the
modules/
directory or.resource_types/
directory):# Add the files git add Puppetfile Puppetfile.simp hiera.yaml environment.conf # Add directories git add manifests/ data/
Commit the changes
git commit -m "Initial production environment"
Push the branch to your control repository:
# Add a remote for your control repository git remote add control_repo <URL to the control repo> # Push the branch git push production control_repo
This procedure creates a control repository with a branch for an environment
named called dev1
. The Puppet modules will be deployed from the SIMP
project's public git repositories over the internet.
Important
If you intend to use this environment :ref:`to bootstrap a SIMP server
without RPMs <howto-bootstrapping-a-simpserver-without-rpms>`,
it must be named production
(and not dev1
).
Prerequisites
You will need the SIMP Puppet environment "skeleton" directory, which can be obtained from one of the following sources:
/usr/share/simp/environment-skeleton/puppet/
when the RPM package simp-environment-skeleton is installed [1].environments/puppet/
under a checkout of the git repository https://github.com/simp/simp-environment-skeleton.
[1] | If your working host doesn't have the simp-environment-skeleton RPM and you'd like to install it, you can set up the SIMP yum repositories (see ":ref:`gsg-installing_simp_from_a_repository`)." |
Procedure
Create an empty git repository:
mkdir $HOME/control-repo cd $HOME/control-repo git init .
Copy the puppet environment skeleton into your git repository:
cd $HOME/control-repo cp -R /usr/share/simp/environment-skeleton/puppet/* .
Substitute your environment's name into
environment.conf
:sed -e "s/%%SKELETON_ENVIRONMENT%%/dev1/g" ./environment.conf.TEMPLATE > ./environment.conf chmod 640 environment.conf rm environment.conf.TEMPLATE
Download and edit the :file:`Puppetfile.simp` file:
Download the :file:`Puppetfile` used to create a SIMP ISO for a specific release from the SIMP simp-core repository (in this example, it is
6.4.0-0
):cd /etc/puppetlabs/code/environments/dev1 curl -o Puppetfile.simp https://github.com/simp/simp-core/blob/6.4.0-0/Puppetfile.pinned
Edit :file:`Puppetfile.simp` to remove components that are not Puppet modules, deleting all lines up to and including
moduledir 'src/puppet/modules'
. You can do this from the command line by running:sed -i -e "0,/^moduledir 'src\/puppet\/modules'/d" Puppetfile.simp
(Optionally,) edit :file:`Puppetfile.simp` to remove any non-core SIMP modules (e.g., the ones packaged with
simp-extras
) that you don't need. You can discover the list of the SIMP extra modules by examining the dependencies of thesimp-extras
RPM:yum deplist simp-extras | grep dependency:
Create the :file:`Puppetfile`:
Create the file :file:`$HOME/control-repo/Puppetfile`, which should include the following line:
instance_eval(File.read(File.join(__dir__,"Puppetfile.simp")))
(Optionally,) also add entries for any non-SIMP modules your site requires.
Add/adjust any of the :term:`Hiera` files in the :file:`data/` directory.
Add all the files to a branch named for the environment in this repository:
# create the branch git checkout -b dev1 # add the directory tree git add --all # verify the directory tree doesn't have any temporary files you created git status git commit -m 'Initial dev1 environment'
Push the branch to your control repository:
# Add a remote for your control repository git remote add control_repo <URL to the control repo> # Push the branch git push dev1 control_repo
A full set of SIMP module RPMs is not required in order for the SIMP server to
be initially configured. With a slight change to the procedures listed in
:ref:`ug-initial_server_configuration`, a SIMP server can be bootstrapped
with a production
SIMP Omni-Environment skeleton, such as one created
in this HOWTO.
Note
You may want to read through :ref:`ug-initial_server_configuration` before proceeding. It provides additional information that will not be repeated here.
In these procedures, we assume that you have created a production
SIMP
Omni-Environment skeleton that contains a Puppetfile with URLs to the core
SIMP Puppet modules. For example, you followed the procedures to create a
control repository for a production
environment using internet module
repositories.
Execute the following steps as root
:
Deploy the modules in the
production
Puppet environment using :program:`r10K` orCode Manager
. Be sure the deployed modules are accessible to thepuppet
group.Install the
puppetserver
package:yum install puppetserver
Run :command:`simp config` with an option that tells it the SIMP Omni-Environment has already been created:
simp config --force-config
Run :command:`simp bootstrap`:
simp bootstrap
After :command:`simp bootstrap` completes, add the following generated Hiera files in the
production
Puppet environment to theproduction
branch in your control repository:
To continue configuring the system, move on :ref:`Client_Management` section in the :ref:`simp-user-guide`.