4.11.19. HOWTO Set up a SIMP Environment in a Control Repository¶
To use any of the procedures in this section, you must:
- Have access to a remotely-hosted Git repository where you will host your control repository.
- Have a basic understanding of:
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 to just the control repository—the RPM-provided Puppet module git repositories will remain on the SIMP server’s local filesystem.
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.
- You have installed SIMP (per the installation guide) from ISO or RPM Repository.
- This procedure needs to be done on the SIMP server.
Create a git repository inside the
productionPuppet environment directory:
cd /etc/puppetlabs/code/environments/production git init .
Create a new branch for the
git checkout -b production
Add files to the git repository. (Do not add the
# 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 environemnt"
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
dev1. The Puppet modules will be deployed from the SIMP
project’s public git repositories over the internet.
If you intend to use this environment to bootstrap a SIMP server
it must be named
production (and not
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 .
environments/puppet/under a checkout of the git repository https://github.com/simp/simp-environment-skeleton.
|||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 “Installing SIMP From A Repository).”|
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
sed -e "s/%%SKELETON_ENVIRONMENT%%/dev1/g" ./environment.conf.TEMPLATE > ./environment.conf chmod 640 environment.conf rm environment.conf.TEMPLATE
Download and edit the
Puppetfileused to create a SIMP ISO for a specific release from the SIMP simp-core repository (in this example, it is
cd /etc/puppetlabs/code/environments/dev1 curl -o Puppetfile.simp https://github.com/simp/simp-core/blob/6.4.0-0/Puppetfile.pinned
Puppetfile.simpto 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
Puppetfile.simpto 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 the
yum deplist simp-extras | grep dependency:
Create the file
$HOME/control-repo/Puppetfile, which should include the following line:
(Optionally,) also add entries for any non-SIMP modules your site requires.
Add/adjust any of the Hiera files in the
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
Initial SIMP Server Configuration, a SIMP server can be bootstrapped
production SIMP Omni-Environment skeleton, such as one created
in this HOWTO.
You may want to read through Initial SIMP Server Configuration before proceeding. It provides additional information that will not be repeated here.
In these procedures, we assume that you have created a
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
Execute the following steps as
Deploy the modules in the
productionPuppet environment using
Code Manager. Be sure the deployed modules are accessible to the
yum install puppetserver
simp configwith an option that tells it the SIMP Omni-Environment has already been created:
simp config --force-config
simp bootstrapcompletes, add the following generated Hiera files in the
productionPuppet environment to the
productionbranch in your control repository:
production/data/hosts/<SIMP server FQDN>.yaml