Compare commits
No commits in common. "production" and "1.1.0" have entirely different histories.
production
...
1.1.0
@ -1 +0,0 @@
|
||||
* @puppetlabs/cs-arch
|
14
Puppetfile
14
Puppetfile
@ -2,16 +2,16 @@ forge 'https://forge.puppet.com'
|
||||
|
||||
# Modules from the Puppet Forge
|
||||
# Versions should be updated to be the latest at the time you start
|
||||
#mod 'puppetlabs/inifile', '5.0.1'
|
||||
#mod 'puppetlabs/stdlib', '7.0.1'
|
||||
#mod 'puppetlabs/concat', '7.0.1'
|
||||
#mod 'puppetlabs/inifile', '2.2.1'
|
||||
#mod 'puppetlabs/stdlib', '4.25.1'
|
||||
#mod 'puppetlabs/concat', '4.2.1'
|
||||
|
||||
# Modules from Git
|
||||
# Examples: https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#examples
|
||||
#mod 'apache',
|
||||
# git: 'https://github.com/puppetlabs/puppetlabs-apache',
|
||||
# commit: '1b6f89afdde0df7f9433a163d5c4b5328eac5779'
|
||||
# :git => 'https://github.com/puppetlabs/puppetlabs-apache',
|
||||
# :commit => 'de290646f97e04b4b8e42c70f6e01e860c394ce7'
|
||||
|
||||
#mod 'apache',
|
||||
# git: 'https://github.com/puppetlabs/puppetlabs-apache',
|
||||
# branch: 'docs_experiment'
|
||||
# :git => 'https://github.com/puppetlabs/puppetlabs-apache',
|
||||
# :branch => 'docs_experiment'
|
||||
|
26
README.md
26
README.md
@ -10,7 +10,7 @@
|
||||
|
||||
## What You Get From This control-repo
|
||||
|
||||
This is a template [control repository](https://puppet.com/docs/pe/latest/control_repo.html) that has the minimum amount of scaffolding to make it easy to get started with [r10k](https://puppet.com/docs/pe/latest/r10k.html) or Puppet Enterprise's [Code Manager](https://puppet.com/docs/pe/latest/code_mgr.html).
|
||||
This is a template [control repository](https://puppet.com/docs/pe/latest/code_management/control_repo.html) that has the minimum amount of scaffolding to make it easy to get started with [r10k](https://puppet.com/docs/pe/latest/code_management/r10k.html) or Puppet Enterprise's [Code Manager](https://puppet.com/docs/pe/latest/code_management/code_mgr.html).
|
||||
|
||||
The important files and items in this template are as follows:
|
||||
|
||||
@ -18,10 +18,10 @@ The important files and items in this template are as follows:
|
||||
* An example Puppetfile with various module references.
|
||||
* An example Hiera configuration file and data directory with pre-created common.yaml and nodes directory.
|
||||
* These match the default hierarchy that ships with PE.
|
||||
* An [environment.conf](https://puppet.com/docs/puppet/7/config_file_environment.html) that correctly implements:
|
||||
* An [environment.conf](https://puppet.com/docs/puppet/5.3/config_file_environment.html) that correctly implements:
|
||||
* A site-modules directory for roles, profiles, and any custom modules for your organization.
|
||||
* A config\_version script.
|
||||
* An example [config\_version](https://puppet.com/docs/puppet/7/config_file_environment.html#environment-conf-allowed-settings) script that outputs the git commit ID of the code that was used during a Puppet run.
|
||||
* An example [config\_version](https://puppet.com/docs/puppet/5.3/config_file_environment.html#configversion) script that outputs the git commit ID of the code that was used during a Puppet run.
|
||||
|
||||
Here's a visual representation of the structure of this repository:
|
||||
|
||||
@ -54,13 +54,13 @@ To get started with using the control-repo template in your own environment and
|
||||
|
||||
1. Install GitLab.
|
||||
* <https://about.gitlab.com/downloads/>
|
||||
1. After GitLab is installed you may sign in with the `root` user. If you didn't specify a custom password during installation, a temporary password is located in `/etc/gitlab/initial_root_password`.
|
||||
1. After GitLab is installed you may sign in with the `root` user and password `5iveL!fe`.
|
||||
1. Make a user for yourself.
|
||||
1. Make an SSH key to link with your user. You’ll want to do this on the machine you intend to edit code from (most likely not your Puppet master, but your local workstation or laptop).
|
||||
* <https://docs.gitlab.com/ee/ssh/index.html>
|
||||
* <http://doc.gitlab.com/ce/ssh/README.html>
|
||||
* <https://help.github.com/articles/generating-ssh-keys/>
|
||||
1. Create a group called `puppet` (this is case sensitive).
|
||||
* <https://docs.gitlab.com/ee/user/group/index.html>
|
||||
* <http://doc.gitlab.com/ce/workflow/groups.html>
|
||||
1. Add your user to the `puppet` group as well.
|
||||
1. Create a project called `control-repo`, and set the Namespace to be the `puppet` group.
|
||||
1. Clone this control repository to your laptop/workstation:
|
||||
@ -95,14 +95,7 @@ To get started with using the control-repo template in your own environment and
|
||||
|
||||
### GitHub
|
||||
|
||||
Follow [GitHub's documentation](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template) to create your control repository starting from this template.
|
||||
|
||||
<img width="429" alt="template button" src="https://user-images.githubusercontent.com/1392917/117215366-f4eeb280-adb2-11eb-9108-1bd45c4d98f3.png">
|
||||
|
||||
|
||||
### GitHub Enterprise
|
||||
|
||||
1. Prepare your local git client to authenticate with a **local GitHub Enterprise instance**.
|
||||
1. Prepare your local git client to authenticate with GitHub.com or a local GitHub Enterprise instance.
|
||||
* <https://help.github.com/articles/generating-ssh-keys/>
|
||||
* <https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/>
|
||||
1. Create a repository called `control-repo` in your user account or organization. Ensure that "Initialize this repository with a README" is not selected.
|
||||
@ -120,4 +113,7 @@ Follow [GitHub's documentation](https://docs.github.com/en/github/creating-cloni
|
||||
|
||||
## Code Manager Setup
|
||||
|
||||
If you use Puppet Enterprise see the official [documentation](https://puppet.com/docs/pe/latest/code_mgr.html) for enabling Code Manager.
|
||||
If you use Puppet Enterprise and have not yet enabled and configured Code Manager, in addition to reading the official [documentation](https://puppet.com/docs/pe/latest/code_management/code_mgr.html) for enabling it, you may want to look at the Ramp-Up Program's control repository instead of this one. It's similar to this repo except that it has batteries included, so to speak. There are pre-built profiles for configuring Code Manager, generating SSH keys, and setting up your Git server to work with Code Manager.
|
||||
|
||||
* <https://github.com/Puppet-RampUpProgram/control-repo>
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
modulepath = site-modules:modules:$basemodulepath
|
||||
config_version = 'scripts/config_version.sh $environmentpath $environment'
|
||||
modulepath = site-modules:modules:$basemodulepath
|
||||
config_version = 'scripts/config_version.sh $environmentpath $environment'
|
||||
|
@ -5,8 +5,8 @@ defaults:
|
||||
datadir: "data"
|
||||
|
||||
hierarchy:
|
||||
- name: "Yaml backend"
|
||||
- name: 'Yaml backend'
|
||||
data_hash: yaml_data
|
||||
paths:
|
||||
- "nodes/%{trusted.certname}.yaml"
|
||||
- "common.yaml"
|
||||
- 'common.yaml'
|
||||
|
@ -1,29 +1,30 @@
|
||||
## site.pp ##
|
||||
|
||||
# This file (./manifests/site.pp) is the main entry point
|
||||
# This file (/etc/puppetlabs/puppet/manifests/site.pp) is the main entry point
|
||||
# used when an agent connects to a master and asks for an updated configuration.
|
||||
# https://puppet.com/docs/puppet/latest/dirs_manifest.html
|
||||
#
|
||||
# Global objects like filebuckets and resource defaults should go in this file,
|
||||
# as should the default node definition if you want to use it.
|
||||
# as should the default node definition. (The default node can be omitted
|
||||
# if you use the console and don't define any other nodes in site.pp. See
|
||||
# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on
|
||||
# node definitions.)
|
||||
|
||||
## Active Configurations ##
|
||||
|
||||
# Disable filebucket by default for all File resources:
|
||||
# https://github.com/puppetlabs/docs-archive/blob/master/pe/2015.3/release_notes.markdown#filebucket-resource-no-longer-created-by-default
|
||||
#https://docs.puppet.com/pe/2015.3/release_notes.html#filebucket-resource-no-longer-created-by-default
|
||||
File { backup => false }
|
||||
|
||||
## Node Definitions ##
|
||||
# DEFAULT NODE
|
||||
# Node definitions in this file are merged with node data from the console. See
|
||||
# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on
|
||||
# node definitions.
|
||||
|
||||
# The default node definition matches any node lacking a more specific node
|
||||
# definition. If there are no other node definitions in this file, classes
|
||||
# and resources declared in the default node definition will be included in
|
||||
# every node's catalog.
|
||||
#
|
||||
# Note that node definitions in this file are merged with node data from the
|
||||
# Puppet Enterprise console and External Node Classifiers (ENC's).
|
||||
#
|
||||
# For more on node definitions, see: https://puppet.com/docs/puppet/latest/lang_node_definitions.html
|
||||
# definition. If there are no other nodes in this file, classes declared here
|
||||
# will be included in every node's catalog, *in addition* to any classes
|
||||
# specified in the console for that node.
|
||||
|
||||
node default {
|
||||
# This is where you can declare classes for all nodes.
|
||||
# Example:
|
||||
|
@ -1,35 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Usage
|
||||
if [ $# -ne 2 -o ! -d "$1" -o ! -d "$1/$2" ]; then
|
||||
echo "usage: $0 <environmentpath> <environment>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# For portability, identify a preferred ruby executable to use
|
||||
ruby() {
|
||||
[ -x /opt/puppetlabs/puppet/bin/ruby ] \
|
||||
&& /opt/puppetlabs/puppet/bin/ruby "$@" \
|
||||
|| /usr/bin/env ruby "$@"
|
||||
}
|
||||
|
||||
# Determine how best to calculate a config_version
|
||||
if [ -e $1/$2/.r10k-deploy.json ]; then
|
||||
# The environment was deployed using r10k. We will calculate the config
|
||||
# version using the r10k data.
|
||||
ruby $1/$2/scripts/config_version-r10k.rb $1 $2
|
||||
|
||||
elif [ -e /opt/puppetlabs/server/pe_version ]; then
|
||||
# This is a Puppet Enterprise system and we can rely on the rugged ruby gem
|
||||
# being available.
|
||||
ruby $1/$2/scripts/config_version-rugged.rb $1 $2
|
||||
|
||||
elif type git >/dev/null; then
|
||||
# The git command is available.
|
||||
git --git-dir $1/$2/.git rev-parse HEAD
|
||||
|
||||
#!/bin/bash
|
||||
if [ -e $1/$2/.r10k-deploy.json ]
|
||||
then
|
||||
/opt/puppetlabs/puppet/bin/ruby $1/$2/scripts/code_manager_config_version.rb $1 $2
|
||||
elif [ -e /opt/puppetlabs/server/pe_version ]
|
||||
then
|
||||
/opt/puppetlabs/puppet/bin/ruby $1/$2/scripts/config_version.rb $1 $2
|
||||
else
|
||||
# Nothing else available; just use the date.
|
||||
/usr/bin/git --version > /dev/null 2>&1 &&
|
||||
/usr/bin/git --git-dir $1/$2/.git rev-parse HEAD ||
|
||||
date +%s
|
||||
|
||||
fi
|
||||
|
@ -1,9 +0,0 @@
|
||||
# This is a description for my plan
|
||||
plan adhoc::myplan(
|
||||
# input parameters go here
|
||||
TargetSpec $targets,
|
||||
) {
|
||||
|
||||
# plan steps go here
|
||||
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"description": "This is the description for the nix_example task",
|
||||
"input_method": "environment"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# task content goes here
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"description": "This is the description for the win_example task",
|
||||
"input_method": "powershell"
|
||||
}
|
@ -1 +0,0 @@
|
||||
# task content goes here
|
Loading…
Reference in New Issue
Block a user