Compare commits

...

54 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
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
14 changed files with 95 additions and 47 deletions

1
CODEOWNERS Normal file
View File

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

View File

@ -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'

View File

@ -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. 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).
* <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.

View File

@ -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'

View File

@ -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"

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:
#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:

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

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