Compare commits
54 Commits
1.1.0
...
production
Author | SHA1 | Date | |
---|---|---|---|
![]() |
46cbe43c54 | ||
![]() |
4ba55106b7 | ||
![]() |
a1f3a826de | ||
![]() |
904afc7020 | ||
![]() |
1397dd7a22 | ||
![]() |
9302714509 | ||
![]() |
831d665de9 | ||
![]() |
7a5498c05e | ||
![]() |
6246354f47 | ||
![]() |
d5ae85cc48 | ||
![]() |
e781ffc001 | ||
![]() |
ab2fc06328 | ||
![]() |
01a2757a2c | ||
![]() |
694e89034b | ||
![]() |
7a2efe24e0 | ||
![]() |
3ea34209fe | ||
![]() |
fe708d35b6 | ||
![]() |
76aa3960c9 | ||
![]() |
c4ca5e9b46 | ||
![]() |
061ca3be10 | ||
![]() |
f4c9cd90fc | ||
![]() |
063ff0e342 | ||
![]() |
4471cd665e | ||
![]() |
60ee3081e6 | ||
![]() |
90e3dce67b | ||
![]() |
499bd376c0 | ||
![]() |
7d3bd4ca2a | ||
![]() |
eb60aab156 | ||
![]() |
c6892b263d | ||
![]() |
a95701bce5 | ||
![]() |
fd89d9a7db | ||
![]() |
33ee3da468 | ||
![]() |
5fd7099181 | ||
![]() |
b7044e4888 | ||
![]() |
36c1c0594d | ||
![]() |
eaa032205d | ||
![]() |
197fd56edf | ||
![]() |
882089207c | ||
![]() |
c52c39d245 | ||
![]() |
f992c8c96d | ||
![]() |
1041362ee1 | ||
![]() |
58103e4ef4 | ||
![]() |
bfb2d7a182 | ||
![]() |
458877f386 | ||
![]() |
e46d209f19 | ||
![]() |
ada94157a4 | ||
![]() |
bee4fc2740 | ||
![]() |
dddbd8d15c | ||
![]() |
535d94437b | ||
![]() |
a8c6d51264 | ||
![]() |
415a71dd59 | ||
![]() |
211ecc58b5 | ||
![]() |
61d0147e49 | ||
![]() |
ffc1769d2e |
1
CODEOWNERS
Normal file
1
CODEOWNERS
Normal file
@ -0,0 +1 @@
|
||||
* @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', '2.2.1'
|
||||
#mod 'puppetlabs/stdlib', '4.25.1'
|
||||
#mod 'puppetlabs/concat', '4.2.1'
|
||||
#mod 'puppetlabs/inifile', '5.0.1'
|
||||
#mod 'puppetlabs/stdlib', '7.0.1'
|
||||
#mod 'puppetlabs/concat', '7.0.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 => 'de290646f97e04b4b8e42c70f6e01e860c394ce7'
|
||||
# git: 'https://github.com/puppetlabs/puppetlabs-apache',
|
||||
# commit: '1b6f89afdde0df7f9433a163d5c4b5328eac5779'
|
||||
|
||||
#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/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).
|
||||
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).
|
||||
|
||||
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/5.3/config_file_environment.html) that correctly implements:
|
||||
* An [environment.conf](https://puppet.com/docs/puppet/7/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/5.3/config_file_environment.html#configversion) 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/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.
|
||||
|
||||
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 and password `5iveL!fe`.
|
||||
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. 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).
|
||||
* <http://doc.gitlab.com/ce/ssh/README.html>
|
||||
* <https://docs.gitlab.com/ee/ssh/index.html>
|
||||
* <https://help.github.com/articles/generating-ssh-keys/>
|
||||
1. Create a group called `puppet` (this is case sensitive).
|
||||
* <http://doc.gitlab.com/ce/workflow/groups.html>
|
||||
* <https://docs.gitlab.com/ee/user/group/index.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,7 +95,14 @@ To get started with using the control-repo template in your own environment and
|
||||
|
||||
### GitHub
|
||||
|
||||
1. Prepare your local git client to authenticate with GitHub.com or a local GitHub Enterprise instance.
|
||||
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**.
|
||||
* <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.
|
||||
@ -113,7 +120,4 @@ To get started with using the control-repo template in your own environment and
|
||||
|
||||
## Code Manager Setup
|
||||
|
||||
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>
|
||||
|
||||
If you use Puppet Enterprise see the official [documentation](https://puppet.com/docs/pe/latest/code_mgr.html) for enabling Code Manager.
|
||||
|
@ -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,30 +1,29 @@
|
||||
## site.pp ##
|
||||
|
||||
# This file (/etc/puppetlabs/puppet/manifests/site.pp) is the main entry point
|
||||
# This file (./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. (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.)
|
||||
# as should the default node definition if you want to use it.
|
||||
|
||||
## Active Configurations ##
|
||||
|
||||
# Disable filebucket by default for all File resources:
|
||||
#https://docs.puppet.com/pe/2015.3/release_notes.html#filebucket-resource-no-longer-created-by-default
|
||||
# https://github.com/puppetlabs/docs-archive/blob/master/pe/2015.3/release_notes.markdown#filebucket-resource-no-longer-created-by-default
|
||||
File { backup => false }
|
||||
|
||||
# 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.
|
||||
## Node Definitions ##
|
||||
|
||||
# The default node definition matches any node lacking a more specific node
|
||||
# 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.
|
||||
|
||||
# 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
|
||||
node default {
|
||||
# This is where you can declare classes for all nodes.
|
||||
# Example:
|
||||
|
@ -1,12 +1,35 @@
|
||||
#!/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
|
||||
/usr/bin/git --version > /dev/null 2>&1 &&
|
||||
/usr/bin/git --git-dir $1/$2/.git rev-parse HEAD ||
|
||||
date +%s
|
||||
#!/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
|
||||
|
||||
else
|
||||
# Nothing else available; just use the date.
|
||||
date +%s
|
||||
|
||||
fi
|
||||
|
9
site-modules/adhoc/plans/myplan.pp
Normal file
9
site-modules/adhoc/plans/myplan.pp
Normal file
@ -0,0 +1,9 @@
|
||||
# This is a description for my plan
|
||||
plan adhoc::myplan(
|
||||
# input parameters go here
|
||||
TargetSpec $targets,
|
||||
) {
|
||||
|
||||
# plan steps go here
|
||||
|
||||
}
|
4
site-modules/adhoc/tasks/nix_example.json
Normal file
4
site-modules/adhoc/tasks/nix_example.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"description": "This is the description for the nix_example task",
|
||||
"input_method": "environment"
|
||||
}
|
3
site-modules/adhoc/tasks/nix_example.sh
Normal file
3
site-modules/adhoc/tasks/nix_example.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# task content goes here
|
4
site-modules/adhoc/tasks/win_example.json
Normal file
4
site-modules/adhoc/tasks/win_example.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"description": "This is the description for the win_example task",
|
||||
"input_method": "powershell"
|
||||
}
|
1
site-modules/adhoc/tasks/win_example.ps1
Normal file
1
site-modules/adhoc/tasks/win_example.ps1
Normal file
@ -0,0 +1 @@
|
||||
# task content goes here
|
Loading…
Reference in New Issue
Block a user