From 4e2a2b81cf17909647728a0c9febab7ab0370e65 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 13 Jan 2015 16:42:06 -0800 Subject: Initial Commit Stole Gary's puppet_repository and modified it for general general consumption. Upped the version of r10k to newest (1.4.1) Ripped out the hiera examples just left defaults.yaml Tweaked environment.conf --- environment.conf | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 environment.conf (limited to 'environment.conf') diff --git a/environment.conf b/environment.conf new file mode 100644 index 0000000..6511fe4 --- /dev/null +++ b/environment.conf @@ -0,0 +1,8 @@ +modulepath = modules:$basemodulepath +config_version = '/usr/bin/git --git-dir $confdir/environments/$environment/.git rev-parse HEAD' + +# Environment timeout should be set to unlimited. When set to zero it is less performant. +# When code is deployed the admin API of puppetserver should be used to force a refresh of code from disk. +# https://docs.puppetlabs.com/puppetserver/1.0/release_notes.html#new-feature-admin-api-for-refreshing-environments +# https://docs.puppetlabs.com/puppet/3.7/reference/environments_configuring.html#environmenttimeout +environment_timeout = 0 -- cgit v1.2.3 From 944a0300cf187c97db8ffdeb3507b0d8b2dc4182 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Wed, 27 May 2015 14:55:24 -0700 Subject: add site to modulepath in environment.conf --- environment.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'environment.conf') diff --git a/environment.conf b/environment.conf index 6511fe4..95c2be1 100644 --- a/environment.conf +++ b/environment.conf @@ -1,4 +1,4 @@ -modulepath = modules:$basemodulepath +modulepath = site:modules:$basemodulepath config_version = '/usr/bin/git --git-dir $confdir/environments/$environment/.git rev-parse HEAD' # Environment timeout should be set to unlimited. When set to zero it is less performant. -- cgit v1.2.3 From bc6bae23d79aed7b05ac018496b8cddc02fe4fba Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Fri, 26 Jun 2015 10:21:51 -0700 Subject: Update environment.conf --- environment.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'environment.conf') diff --git a/environment.conf b/environment.conf index 95c2be1..a1579ce 100644 --- a/environment.conf +++ b/environment.conf @@ -1,4 +1,4 @@ -modulepath = site:modules:$basemodulepath +modulepath = modules:site:$basemodulepath config_version = '/usr/bin/git --git-dir $confdir/environments/$environment/.git rev-parse HEAD' # Environment timeout should be set to unlimited. When set to zero it is less performant. -- cgit v1.2.3 From f5cb1fa75796327cefe8054efeab855c143ef2e3 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Mon, 3 Aug 2015 17:05:06 -0700 Subject: Update config_version to use a script that does not require git The config_version now uses a script that will do one of two things: 1. call config_version.rb which uses rugged to find the information about the latest commit if PE is on version 2015.2 or newer 2. make a call to git if the PE version is less than 2015.2 --- environment.conf | 2 +- scripts/config_version.rb | 17 +++++++++++++++++ scripts/config_version.sh | 7 +++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 scripts/config_version.rb create mode 100644 scripts/config_version.sh (limited to 'environment.conf') diff --git a/environment.conf b/environment.conf index a1579ce..6d60708 100644 --- a/environment.conf +++ b/environment.conf @@ -1,5 +1,5 @@ modulepath = modules:site:$basemodulepath -config_version = '/usr/bin/git --git-dir $confdir/environments/$environment/.git rev-parse HEAD' +config_version = 'scripts/config_version.sh $environmentpath $environment' # Environment timeout should be set to unlimited. When set to zero it is less performant. # When code is deployed the admin API of puppetserver should be used to force a refresh of code from disk. diff --git a/scripts/config_version.rb b/scripts/config_version.rb new file mode 100644 index 0000000..52f32c5 --- /dev/null +++ b/scripts/config_version.rb @@ -0,0 +1,17 @@ +require 'rugged' + +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 diff --git a/scripts/config_version.sh b/scripts/config_version.sh new file mode 100644 index 0000000..1f42d34 --- /dev/null +++ b/scripts/config_version.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if [ -e /opt/puppetlabs/server/pe_version ] +then + /opt/puppetlabs/puppet/bin/ruby $1/$2/scripts/config_version.rb $1 $2 +else + /usr/bin/git --git-dir $codedir/environments/$environment/.git rev-parse HEAD +fi -- cgit v1.2.3 From 591f9b9f0b262fa7a3099c81aace527e09fbbd0b Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Wed, 28 Oct 2015 11:36:44 -0700 Subject: remove environment_timeout =0 from environment.conf --- environment.conf | 6 ------ 1 file changed, 6 deletions(-) (limited to 'environment.conf') diff --git a/environment.conf b/environment.conf index 6d60708..5ba929b 100644 --- a/environment.conf +++ b/environment.conf @@ -1,8 +1,2 @@ modulepath = modules:site:$basemodulepath config_version = 'scripts/config_version.sh $environmentpath $environment' - -# Environment timeout should be set to unlimited. When set to zero it is less performant. -# When code is deployed the admin API of puppetserver should be used to force a refresh of code from disk. -# https://docs.puppetlabs.com/puppetserver/1.0/release_notes.html#new-feature-admin-api-for-refreshing-environments -# https://docs.puppetlabs.com/puppet/3.7/reference/environments_configuring.html#environmenttimeout -environment_timeout = 0 -- cgit v1.2.3