Compare commits

...

99 Commits

Author SHA1 Message Date
Reid Vandewiele
46cbe43c54
Merge pull request #102 from ekohl/update-links
Update links in README
2022-03-03 14:14:15 -08:00
Reid Vandewiele
4ba55106b7
Merge pull request #105 from taikaa/readme-updates
(docs) corrected Gitlab initial password information
2022-03-03 14:11:42 -08:00
David Sandilands
a1f3a826de
Jumpstart programme is not live (#107)
* Jumpstart programme is not live 

We should remove the mention of the jumpstart programme which appears orphaned and unmaintained

* Update README.md

Co-authored-by: Reid Vandewiele <reid@puppet.com>
2022-03-03 14:03:38 -08:00
TA
904afc7020 (docs) corrected Gitlab initial password information 2021-11-17 16:43:56 -05:00
Ewoud Kohl van Wijngaarden
1397dd7a22
Update links in README
All links to Puppet's Code Manager were broken. The Puppet 5 links are
updated to version 7. The Gitlab links redirect somewhere else. The
direct link saves users a redirect.
2021-10-12 12:52:51 +02:00
Reid Vandewiele
9302714509
Merge pull request #101 from kinners00/adhoc-content
add tasks and plans directories
2021-06-11 09:04:42 -07:00
Marc McKinley
831d665de9
change of language
script > task

Co-authored-by: Reid Vandewiele <reid@puppet.com>
2021-05-19 10:05:44 +01:00
Marc McKinley
7a5498c05e
change of language
script > task

Co-authored-by: Reid Vandewiele <reid@puppet.com>
2021-05-19 10:05:10 +01:00
Marc McKinley
6246354f47
Indentation for JSON
4 spaces, closing brace at same level as opening brace

Co-authored-by: Reid Vandewiele <reid@puppet.com>
2021-05-19 10:04:45 +01:00
Marc McKinley
d5ae85cc48
Indentation fix
Co-authored-by: Reid Vandewiele <reid@puppet.com>
2021-05-19 10:04:27 +01:00
Marc McKinley
e781ffc001
Indentation for JSON
4 spaces, closing brace at same level as opening brace

Co-authored-by: Reid Vandewiele <reid@puppet.com>
2021-05-19 10:03:58 +01:00
Marc McKinley
ab2fc06328
Indent to level of line number (line 4) being described
Co-authored-by: Reid Vandewiele <reid@puppet.com>
2021-05-19 10:03:28 +01:00
Marc McKinley
01a2757a2c
Update win_example.json 2021-05-12 17:43:05 +01:00
Marc McKinley
694e89034b
Rename win.ps1 to win_example.ps1 2021-05-12 17:42:46 +01:00
Marc McKinley
7a2efe24e0
Rename win.json to win_example.json 2021-05-12 17:42:29 +01:00
Marc McKinley
3ea34209fe
Rename nix.sh to nix_example.sh 2021-05-12 17:42:18 +01:00
Marc McKinley
fe708d35b6
Update and rename nix.json to nix_example.json 2021-05-12 17:42:07 +01:00
Marc McKinley
76aa3960c9
Update win.json 2021-05-12 17:20:16 +01:00
Marc McKinley
c4ca5e9b46
Create win.json 2021-05-12 17:17:38 +01:00
Marc McKinley
061ca3be10
Create nix.json 2021-05-12 17:17:23 +01:00
Marc McKinley
f4c9cd90fc
Rename winscript.ps1 to win.ps1 2021-05-12 17:12:32 +01:00
Marc McKinley
063ff0e342
Rename nixscript.sh to nix.sh 2021-05-12 17:12:18 +01:00
Marc McKinley
4471cd665e
Rename script.sh to nixscript.sh 2021-05-12 17:11:54 +01:00
Marc McKinley
60ee3081e6
Rename script.ps1 to winscript.ps1 2021-05-12 17:11:42 +01:00
Marc McKinley
90e3dce67b
Create myplan.pp 2021-05-12 17:10:11 +01:00
Marc McKinley
499bd376c0
Create script.ps1 2021-05-12 15:43:45 +01:00
Marc McKinley
7d3bd4ca2a
adding script.sh 2021-05-12 15:42:07 +01:00
Ben Ford
eb60aab156
Merge pull request #100 from puppetlabs/binford2k-patch-1
Add template instructions
2021-05-06 11:04:44 -07:00
Ben Ford
c6892b263d
Update README.md
Co-authored-by: Reid Vandewiele <reid@puppet.com>
2021-05-05 15:15:06 -07:00
Ben Ford
a95701bce5
Add template instructions 2021-05-05 15:07:16 -07:00
Reid Vandewiele
fd89d9a7db
Merge pull request #97 from mcka1n/patch-1
update the version of the example modules
2021-05-04 07:13:47 -07:00
Edwin Maldonado
33ee3da468
update the version of the example modules 2021-05-04 15:11:43 +02:00
Reid Vandewiele
5fd7099181
Merge pull request #91 from vulongtran/patch-1
Update README.md
2020-10-21 05:00:27 -10:00
Vu Long Tran
b7044e4888
Update README.md
Sounds good

Co-authored-by: Reid Vandewiele <reid@puppet.com>
2020-10-21 19:37:17 +08:00
Vu Long Tran
36c1c0594d
Update README.md
Updating Code Manager link to the latest - https://puppet.com/docs/pe/2019.8/code_mgr.html. As old link has been updated.
2020-10-19 12:19:36 +08:00
Reid Vandewiele
eaa032205d
Merge pull request #87 from mwaggett/codeowners
(maint) Fix CODEOWNERS
2020-09-10 08:33:02 -10:00
Molly Waggett
197fd56edf (maint) Fix CODEOWNERS 2020-09-10 11:11:37 -07:00
Iristyle
882089207c Revert "add db2 module"
This reverts commit bfb2d7a182.
2019-12-03 13:35:22 -06:00
Iristyle
c52c39d245 Revert "add db2_server role and profile"
This reverts commit 58103e4ef4.
2019-12-03 13:35:22 -06:00
Iristyle
f992c8c96d Revert "include db2 class"
This reverts commit 1041362ee1.
2019-12-03 13:35:22 -06:00
Jesse Reynolds
1041362ee1 include db2 class 2019-11-30 09:23:25 +10:30
Jesse Reynolds
58103e4ef4 add db2_server role and profile 2019-11-30 09:19:21 +10:30
Jesse Reynolds
bfb2d7a182 add db2 module 2019-11-30 08:52:07 +10:30
Reid Vandewiele
458877f386
Merge pull request #65 from smortex/portability-fixes
Improve portability
2019-10-18 15:22:36 -07:00
Reid Vandewiele
e46d209f19 Don't assume git is in /usr/bin; expect it on PATH 2019-10-16 10:05:33 -10:00
Reid Vandewiele
ada94157a4 Restore and clarify config_version functionality
This branch is intended as a portability fix. Some functionailty had
been inadvertently removed as unused, but testing revealed that it had a
purpose. Because the purpose was unclear, this commit restores the
functionality AND clarifies it in the script names and comments in
config_version.sh.
2019-10-16 10:26:21 -07:00
Ben Ford
bee4fc2740
Create CODEOWNERS 2019-08-21 13:58:51 -07:00
Reid Vandewiele
dddbd8d15c (maint) Update Puppetfile versions, update style
This commit updates the Puppetfile example module versions to list the
latest releases for the example modules as of 2019-07-10, and also
updates several files for style.

Standardizing on double-quotes in YAML due to:

1. Functional irrelevance between single vs. double quotes in our YAML
2. Prevalent use of double-quotes in Puppet documentation
3. Similar look-and-feel to other data serialization formats like JSON
2019-07-11 09:33:14 -07:00
adam buxton
535d94437b
Merge pull request #73 from natemccurdy/site_pp_updates
Update outdated info and links in site.pp comments
2019-05-14 20:47:31 +01:00
Nate McCurdy
a8c6d51264
Update outdated info and links in site.pp comments
This commit attempts to cleanup and modernize the comments in site.pp a
bit.

For one thing, I've updated the docs links to point to working URL's.
For another, I tried to reorganize, clarify, and deduplicate the comments.
2019-05-06 17:36:50 -05:00
Reid Vandewiele
306107b98b
Merge pull request #71 from npwalker/rename_site_to_site-modules
Rename site directory to site-modules
2019-02-26 15:26:47 -08:00
Reid Vandewiele
c74c84d243 Update README to reflect site -> site-modules 2019-02-26 09:14:15 -08:00
Reid Vandewiele
baa4b92a88 Remove symlink site -> site-modules
The symlink served for a good discussion point around change impact, but
in the end having it makes for a more confusing experience overall both
to new users cloning the control-repo to get started and also to anyone
accustomed to "site". A new user won't miss "site". A symlink will muddy
the waters over the change for long-time users. Better for clarity to be
all-in and not include a symlink.
2019-02-26 09:14:15 -08:00
Nick Walker
80494c198b Add symlink from site to site-modules for compatibility 2019-02-04 13:04:11 -08:00
Nick Walker
ead7f3c706 Rename site directory to site-modules
Prior to this commit, we placed modules local to a users installation
in the `site` directory.  This was just a convention and the name
`site` doesn't clearly convey what it is for.

After this commit, we place modules local to a users installation in
the `site-modules` directory.  This makes it more clear to users
that this is a directory that modules go i.  When users start
with bolt they won't even know what a control-repo is and
renaming site to site-modules gives them a better idea of why
they should put their modules with tasks in them.  Also see:

https://tickets.puppetlabs.com/browse/BOLT-1108
2019-01-31 16:58:13 -08:00
Craig Sprout
18aa0779ae Fixed typos for 'moduelpath' and 'batteries includes' to 'modulepath' and 'batteries included' 2018-12-07 14:08:09 -08:00
Romain Tartière
415a71dd59 Remove code dead for more than 2 years
r10k generates a .r10k-deploy.json file since version 2.1.0 which was
released on October 28, 2015.  New users of the control-repo are not
likely to have a so old version of r10k, so remove this dead code.
2018-05-11 22:28:40 +02:00
Romain Tartière
211ecc58b5 Do sanity checking early
Fail before doing anything when passed parameters are invalid.
2018-05-11 22:26:49 +02:00
Romain Tartière
61d0147e49 Remove execute permission and shebangs
The appropriate ruby interpreter is determined by the config_version.sh
shell script which explicitely use it to start these ruby scripts.
Removing the execute bit ensure users will not run these script with the
wrong Ruby version.
2018-05-11 22:26:49 +02:00
Romain Tartière
ffc1769d2e Improve portability
- Fix shebang: `bash` is not always in `/bin/`, and since the script
  does not have bashism, rely on `sh` which is always in `/bin/`;
- Use `/opt/puppetlabs/puppet/bin/ruby` if this file exist and is
  executable, otherwise use `ruby` from $PATH;
- Use `code_manager_config_version.rb` if `.r10k-deploy.json` is found,
  and `config_version.rb` in all other cases.
2018-05-11 22:25:27 +02:00
Nate McCurdy
f69ffd8ce1 Update module examples to latest versions 2018-05-08 10:46:30 -07:00
Nate McCurdy
36a2784275 Resolve Rubocop warnings
* Removed the useless assignment in the config_version.rb error catching
* Single quote vs. double quote in Puppetfile
2018-05-08 10:46:30 -07:00
Nate McCurdy
aaa85a0e03
Merge pull request #57 from natemccurdy/config_version
Config Version Improvements
2018-05-08 10:43:35 -07:00
Nate McCurdy
78662f908d
Merge pull request #61 from natemccurdy/readme_markdown
Improve the README
2018-03-13 18:43:43 -07:00
Nate McCurdy
bab3453bb5 Simplify the info about the RampUp Program 2018-03-13 13:47:19 -07:00
Nate McCurdy
fda0396e06 Add a tree view with descriptions of important files 2018-02-06 17:35:34 -08:00
Nate McCurdy
c69edaddda Reorganize the README and improve the documentation
This commit moves the "where did all the previous code go" section to
the bottom as it's been a while since that change was made. Nowadays,
people new to Control Repositories will find this and won't understand
the reference as they never knew about previous versions.

Now the README starts right away with information on what this project
is and how to use it.

Also cleaned up some of the Markdown syntax to make it easier to read.
2018-02-06 17:35:34 -08:00
Nate McCurdy
9b2a0d9029 Fix markdown list syntax 2018-02-06 15:59:51 -08:00
Nate McCurdy
cbeb86670a
Merge pull request #59 from petems/add_bitbucket_instructions
Add Bitbucket/Stash instructions
2018-02-01 11:11:55 -08:00
Peter Souter
096719d759 Add Bitbucket/Stash instructions 2018-02-01 19:10:43 +00:00
Nate McCurdy
e5189b5515 Show the short hostname, not the FQDN in config_version
This is mainly a style and readability change.

Prior to this, on masters whose hostname is actually their FQDN, the
config_version script would show the entire FQDN. On nodes with really
longs FQDN's, it was not very nice to look at.

This takes the hostname of the master, splits it on dots (.) and takes
the first segment.

Now this: compile-master-02.int.lab.dmz.company-name.net-production-48fd18ab
Is this:  compile-master-02-production-48fd18ab
2017-12-15 12:52:14 -06:00
Nate McCurdy
09df4b4961 Use the puppet-agent ruby in config_version.rb
Prior to this, the config_version.rb script (used for r10k) attempted to
use the system ruby to parse the script. This caused problems on Puppet
masters that don't have `ruby` in PATH.

This fixes that by hardcoding the puppet-agent's ruby in the shebang.
2017-12-15 12:48:47 -06:00
Federico Voges
c221d72929
Merge pull request #56 from natemccurdy/gitignore
Ignore modules pulled from r10k
2017-11-28 00:15:38 +00:00
Nate McCurdy
0069299d6f Ignore modules pulled from r10k into modules/
Prior to this, modules that were deployed with r10k into the ./modules
directory weren't being ignored by git.

When doing local development or testing, it's nice to be able to run
'r10k puppetfile install' to pull down modules from the Puppetfile.
After this commit, those modules won't be tracked by git.
2017-11-27 19:08:54 -05:00
Nate McCurdy
c89b8d7ef8
Merge pull request #55 from igalic/patch-1
point "forge" to new canonical URL, with https
2017-11-27 19:06:06 -05:00
Igor Galić
9a13af11c6
point "forge" to new canonical URL, with https 2017-11-27 21:41:11 +01:00
Nate McCurdy
4aa1446323
Merge pull request #53 from reidmv/hiera5
Enable Hiera 5
2017-11-16 15:58:30 -08:00
Nate McCurdy
53d4c56136
Merge pull request #54 from jdesroch/patch-1
Typo fix in README.md
2017-11-15 10:31:59 -08:00
Jody Des Roches
6a887aff94
Update README.md
Small typo fix
2017-11-15 08:28:23 -10:00
Reid Vandewiele
7264b63d10 Enable Hiera 5
This commit enables the control repo to use Hiera 5 environment-level
hiera hierarchy. This means adding a hiera.yaml to the repo, and moving
hieradata/ => data/.

We should do this to the control-repo template new customers base off of
because in a Hiera 5 world, the global hiera.yaml should be very minimal
(possibly even ONLY having the console level), and everything else
(nodes, common) belongs in the environment hiera.yaml.

This control-repo template is how people start using Puppet. It should
reflect using our most modern technologies.
2017-11-15 09:24:40 -08:00
Nate McCurdy
05d7620962 Merge pull request #51 from puppetlabs/whitespace_error
Reverting whitespace commit
2017-09-06 16:39:53 -07:00
Shobhna Shastri
4c0ea09e19 Reverting whitespace commit
There was an accidental commit made on the production branch (d877ba22b6). This commit is to correct and revert the change.
2017-09-06 16:37:30 -07:00
Shobhna Shastri
d877ba22b6 Testing something 2017-08-25 14:06:56 -07:00
Gabriel M. Schuyler
ee0e87de27 Merge pull request #50 from natemccurdy/show_master
config_version: Show the compiling master's name
2017-07-05 17:17:57 -07:00
Nate McCurdy
124b1a2727 config_version: Show the compiling master's name
Prior to this, the config_version script just showed the commit ID of
the version of code being compiled. This commit includes the compiling
Puppet master's hostname and environment name in the config_version.
This is very useful for debugging when a Puppet master is failing and
you have multiple masters behind a load balancer.

The output of config_version now looks like this:

pupmaster01-production-ac9785273a10
2017-07-05 17:09:51 -07:00
Nate McCurdy
ac9785273a Merge pull request #44 from aharden/patch-2
Put local site modules first in modulepath
2017-06-02 17:14:19 -05:00
Nick Walker
c9931ceef7 Add ruby shebang to config_version scripts
Prior to this commit, if you used windows bash git when you clone
down the repo these files would get incorrect permissions which
make them unexecutable.

After this commit, due to some windows bash git magic I don't
understand it appears that adding the shebang to the beginning of
the file causes windows bash git to change the permissions to
so the file is executable.

This resolves https://github.com/puppetlabs/control-repo/issues/40
2016-11-22 13:20:15 -08:00
Nate McCurdy
fcab12f772 Merge pull request #46 from aharden/patch-1
Add GitHub instructions
2016-11-08 11:34:09 -08:00
Alex Harden
d2a890ceae Add GitHub instructions
Per Issue https://github.com/puppetlabs/control-repo/issues/26
2016-11-08 13:47:29 -05:00
Alex Harden
c26b42aa43 Put local site modules first in modulepath
Saw this issue referenced in @glarizza's PuppetConf 2016 talk (raised by @alvagante). Our (TE Connectivity) implementation reflects this.
2016-11-08 12:57:46 -05:00
Alex Harden
b6af290069 Provide permalink for filebucket deprecation (#43)
"Latest" stopped resolving several PE releases ago.
2016-10-26 07:46:56 -07:00
Nick Walker
5497d199b3 Remove max_requests_per_instance since hiera-eyaml is fixed
Prior to this commit, we mitigated issues with hiera-eyaml causing
a memory leak by setting max_requets_per_instance to 0

After this commit, we go back to the default for
max_requests_per_instance because the hiera-eyaml memory leak
has been resolved for months if you use the newest version
2016-08-04 15:51:07 -07:00
Nick Walker
e0d6feea18 Merge pull request #38 from reidmv/fix_cm_perms
Set the execute bit for CM config version script
2016-06-29 08:38:27 -07:00
Reid Vandewiele
d340dd2288 Set the execute bit for CM config version script
The execute bit needs to be set or CM will fail.

I think this was probably just missed when the
code_manager_config_version.rb file was added.
2016-06-29 15:42:23 +01:00
Nick Walker
e8361dd21c Merge pull request #37 from dylanratcliffe/remove-role
Remove old role all_in_one_pe
2016-06-15 10:02:38 -07:00
Dylan Ratcliffe
aa2dba158b Removed old role 2016-06-14 14:37:43 +10:00
Nick Walker
b9d9eb0bb3 Update README with new Ramp Up Program URL 2016-05-27 10:37:55 -07:00
Gary Larizza
01346d7d21 Merge pull request #32 from jbondpdx/production
light editing, mostly for style
2016-05-11 16:27:10 -07:00
jbondpdx
cd17888a90 light editing, mostly for style 2016-05-11 15:30:53 -07:00
26 changed files with 238 additions and 140 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
hieradata/nodes/example-puppet-master.yaml
modules/

1
CODEOWNERS Normal file
View File

@ -0,0 +1 @@
* @puppetlabs/cs-arch

View File

@ -1,17 +1,17 @@
forge "http://forge.puppetlabs.com"
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", '1.5.0'
#mod "puppetlabs/stdlib", '4.11.0'
#mod "puppetlabs/concat", '2.1.0'
#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 => '83401079053dca11d61945bd9beef9ecf7576cbf'
# 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'

164
README.md
View File

@ -1,85 +1,123 @@
Table of Contents
=================
# A Puppet Control Repository
* [Where Did All The Previous Code Go?](#where-did-all-the-previous-code-go)
* [What You Get From This control\-repo](#what-you-get-from-this-control-repo)
* [Copy This Repo Into Your Own Git Server](#copy-this-repo-into-your-own-git-server)
* [Gitlab](#gitlab)
* [Stash](#stash)
* [Github](#github)
* [What You Get From This control\-repo](#what-you-get-from-this-control-repo)
* [Copy This Repo Into Your Own Git Server](#copy-this-repo-into-your-own-git-server)
* [GitLab](#gitlab)
* [Bitbucket/Stash](#bitbucketstash)
* [Github](#github)
* [Code Manager Setup](#code-manager-setup)
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc.go)
# Where Did All The Previous Code Go?
## What You Get From This control-repo
Initially, the control-repo project began as a 'starter' template for anyone
who wanted to get started with R10k. As time passed (and Code Manager was
integrated into Puppet Enterprise), the scope of this project grew to include
opinionated Puppet profiles to setup many Puppet Enterprise components. As the
code increased, so did the complexity of the control-repo project. To reduce
that complexity, as well as continue to meet the needs of individuals who would
like a more minimal template, this repository was stripped of anything other
than the bare minimum files necessary to get started with a functioning
control-repo. All of the code that was previously in this repository still
exists in separate repositories under the [Puppet Labs RampUp Program namespace within Github](https://github.com/PuppetLabs-RampUpProgram)
and can easily be re-connected to an existing control-repo if that is required
(simply add the modules to the Puppetfile). Alternatively, if that
previously-opinoinated control-repo is desired, [it still exists on Github under the Puppet Labs RampUp Program namespace.](https://github.com/PuppetLabs-RampUpProgram/control-repo)
This control-repo project will remain a template for anyone who would like a minimal
'starter' template.
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).
# What You Get From This control-repo
The important files and items in this template are as follows:
This repository exists as a template control-repo that can be used with R10k or Puppet Enterprise Code Manager.
* Basic example of roles and profiles.
* 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:
* 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.
The major points are:
- An environment.conf that correctly implements:
- A site directory for roles, profiles, and any custom modules for your organization
- A config_version script
- Provided config_version scripts to output the commit of code that your agent just applied
- Basic example of roles/profiles code
- Example hieradata directory with pre-created common.yaml and nodes directory
- These match the default hierarchy that ships with PE
Here's a visual representation of the structure of this repository:
##Copy This Repo Into Your Own Git Server
```
control-repo/
├── data/ # Hiera data directory.
│   ├── nodes/ # Node-specific data goes here.
│   └── common.yaml # Common data goes here.
├── manifests/
│   └── site.pp # The "main" manifest that contains a default node definition.
├── scripts/
│   ├── code_manager_config_version.rb # A config_version script for Code Manager.
│   ├── config_version.rb # A config_version script for r10k.
│   └── config_version.sh # A wrapper that chooses the appropriate config_version script.
├── site-modules/ # This directory contains site-specific modules and is added to $modulepath.
│   ├── profile/ # The profile module.
│   └── role/ # The role module.
├── LICENSE
├── Puppetfile # A list of external Puppet modules to deploy with an environment.
├── README.md
├── environment.conf # Environment-specific settings. Configures the modulepath and config_version.
└── hiera.yaml # Hiera's configuration file. The Hiera hierarchy is defined here.
```
###Gitlab
## Copy This Repo Into Your Own Git Server
1. Install Gitlab
- https://about.gitlab.com/downloads/
To get started with using the control-repo template in your own environment and git server, we've provided steps for the three most common servers we see: [GitLab](#gitlab), [BitBucket](#bitbucketstash), and [GitHub](#github).
2. After Gitlab is installed you may sign if with the `root` user and password `5iveL!fe`
### GitLab
3. Make a user for yourself
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. Make a user for yourself.
1. Make an SSH key to link with your user. Youll 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>
* <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>
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:
* `git clone <repository url>`
* `cd control-repo`
1. Remove this repository as the origin remote:
* `git remote remove origin`
1. Add your internal repository as the origin remote:
* `git remote add origin <url of your gitlab repository>`
1. Push the production branch of the repository from your machine up to your git server
* `git push origin production`
4. Make an ssh key to link with your user. Youll want to do this on the machine you intend to edit code from ( most likely not your puppet master but your local workstation / laptop )
- http://doc.gitlab.com/ce/ssh/README.html
- https://help.github.com/articles/generating-ssh-keys/
### Bitbucket/Stash
5. Create a group called `puppet` ( this is case sensitive )
- http://doc.gitlab.com/ce/workflow/groups.html
1. Install Bitbucket
* <https://www.atlassian.com/software/bitbucket/download>
1. Make a `Project` called `puppet` (with a short name of `PUP`)
1. Create a repository called `control-repo`
1. Create a user called `r10k` with a password of `puppet`.
* Make the r10k user an admin of the `PUP` project.
1. Either use the admin user to test pushing code, or create a user for yourself and add your SSH key to that user.
* If making a user for yourself, give your user account read/write or admin privilege to the `PUP` project.
1. Clone this control repository to your laptop/workstation
* `git clone <repository url>`
* `cd control-repo`
1. Remove this repository as the origin remote
* `git remote remove origin`
1. Add your internal repository as the origin remote
* `git remote add origin <url of your bitbucket repository>`
1. Push the production branch of the repository from your machine up to your git server
* `git push origin production`
6. Add your user to the `puppet` group as well
### GitHub
7. Create a project called `control-repo` and set the Namespace to be the `puppet` group
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.
8. Clone this control repository to your laptop/workstation
- `git clone <repository url>`
- `cd control-repo`
<img width="429" alt="template button" src="https://user-images.githubusercontent.com/1392917/117215366-f4eeb280-adb2-11eb-9108-1bd45c4d98f3.png">
9. Remove this repository as the origin remote
- `git remote remove origin`
10. Add your internal repository as the origin remote
- `git remote add origin <url of your gitlab repository>`
### GitHub Enterprise
11. Push the production branch of the repository from your machine up to your git server
- `git push origin production`
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.
* <https://help.github.com/articles/creating-a-new-repository/>
1. Make a note of your repository URL (HTTPS or SSH, depending on your security configuration).
1. Clone this control repository to your laptop/workstation:
* `git clone <repository url>`
* `cd control-repo`
1. Remove this repository as the origin remote:
* `git remote remove origin`
1. Add your internal repository as the origin remote:
* `git remote add origin <url of your github repository>`
1. Push the production branch of the repository from your machine up to your git server
* `git push origin production`
###Stash
## Code Manager Setup
Coming soon!
###Github
Coming soon!
If you use Puppet Enterprise see the official [documentation](https://puppet.com/docs/pe/latest/code_mgr.html) for enabling Code Manager.

2
data/common.yaml Normal file
View File

@ -0,0 +1,2 @@
---
message: "This node is using common data"

View File

@ -1,2 +1,2 @@
modulepath = modules:site:$basemodulepath
config_version = 'scripts/config_version.sh $environmentpath $environment'
modulepath = site-modules:modules:$basemodulepath
config_version = 'scripts/config_version.sh $environmentpath $environment'

12
hiera.yaml Normal file
View File

@ -0,0 +1,12 @@
---
version: 5
defaults:
datadir: "data"
hierarchy:
- name: "Yaml backend"
data_hash: yaml_data
paths:
- "nodes/%{trusted.certname}.yaml"
- "common.yaml"

View File

@ -1,5 +0,0 @@
---
message: "This node is using common data"
#Puppet Server Tuning
puppet_enterprise::master::puppetserver::jruby_max_requests_per_instance: 0

View File

@ -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:
#http://docs.puppetlabs.com/pe/latest/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:

View File

@ -1,9 +0,0 @@
require 'json'
environmentpath = ARGV[0]
environment = ARGV[1]
r10k_deploy_file_path = File.join(environmentpath, environment, '.r10k-deploy.json')
#output the sha1 from the control-repo
puts JSON.parse(File.read(r10k_deploy_file_path))['signature']

19
scripts/config_version-r10k.rb Executable file
View File

@ -0,0 +1,19 @@
#!/opt/puppetlabs/puppet/bin/ruby
require 'json'
require 'socket'
environmentpath = ARGV[0]
environment = ARGV[1]
# Get the hostname of the Puppet master compiling the catalog.
# Sometimes the hostname is the fqdn, so we'll take the first segment.
compiling_master = Socket.gethostname.split('.').first
# Get the path to the Code Manager deployment info file.
r10k_deploy_file_path = File.join(environmentpath, environment, '.r10k-deploy.json')
# Get the first 12 characters of the commit ID out of the deployment file.
commit_id = JSON.parse(File.read(r10k_deploy_file_path))['signature'][0...11]
# Show the compiling master, environment name, and commit ID.
puts "#{compiling_master}-#{environment}-#{commit_id}"

View File

@ -0,0 +1,25 @@
#!/opt/puppetlabs/puppet/bin/ruby
begin
require 'rugged'
require 'socket'
rescue LoadError
t = Time.new
puts t.to_i
else
environmentpath = ARGV[0]
environment = ARGV[1]
# Get the hostname of the Puppet master compiling the catalog.
# Sometimes the hostname is the fqdn, so we'll take the first segment.
compiling_master = Socket.gethostname.split('.').first
# Get the path to the environment being compiled.
repo = Rugged::Repository.discover(File.join(environmentpath, environment))
head = repo.head
# First 12 characters of the sha1 hash of the newest commit.
commit_id = head.target_id[0...11]
# Show the compiling master, environment name, and commit ID.
puts "#{compiling_master}-#{environment}-#{commit_id}"
end

View File

@ -1,23 +0,0 @@
begin
require 'rugged'
rescue LoadError => e
t = Time.new
puts t.to_i
else
environmentpath = ARGV[0]
environment = ARGV[1]
repo = Rugged::Repository.discover(File.join(environmentpath, environment))
head = repo.head
#sha1 hash of the newest commit
head_sha = head.target_id
#the commit message associated the newest commit
commit = repo.lookup(head_sha)
#add something to find the remote url
puts head_sha
end

View File

@ -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
#!/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
/usr/bin/git --version > /dev/null 2>&1 &&
/usr/bin/git --git-dir $1/$2/.git rev-parse HEAD ||
# Nothing else available; just use the date.
date +%s
fi
fi

View 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
}

View File

@ -0,0 +1,4 @@
{
"description": "This is the description for the nix_example task",
"input_method": "environment"
}

View File

@ -0,0 +1,3 @@
#!/bin/bash
# task content goes here

View File

@ -0,0 +1,4 @@
{
"description": "This is the description for the win_example task",
"input_method": "powershell"
}

View File

@ -0,0 +1 @@
# task content goes here

View File

@ -1,5 +0,0 @@
class role::all_in_one_pe {
include pe_code_manager_webhook
}