Skip to content

Commit 568978d

Browse files
committed
pulling some stuff from npwalker/control-repo
1 parent 1e174e6 commit 568978d

File tree

5 files changed

+62
-0
lines changed

5 files changed

+62
-0
lines changed

Puppetfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
forge "http://forge.puppetlabs.com"
2+
3+
# Modules from the Puppet Forge
4+
# Note the versions are all set to :latest but after you've
5+
# installed you should change them to the exact version you want
6+
mod "puppetlabs/inifile", :latest
7+
mod "puppetlabs/stdlib", :latest
8+
mod "puppetlabs/concat", :latest
9+
10+
#An example of using a specific forge module version instead of latest
11+
#Notice the addition of single quotes
12+
#mod "puppetlabs/inifile", '1.3.0'
13+
14+
# Modules from Github using various references
15+
# Further examples: https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#examples
16+
# update the tag to the most current release when implementing
17+
#mod 'hiera',
18+
# :git => 'https://github.com/hunner/puppet-hiera',
19+
# :tag => '1.3.1'
20+
21+
#mod 'notifyme',
22+
# :git => 'git://github.com/glarizza/puppet-notifyme',
23+
# :ref => '50c01703b2e3e352520a9a2271ea4947fe17a51f'
24+
25+
#mod 'profiles',
26+
# :git => 'git://github.com/glarizza/puppet-profiles',
27+
# :ref => '3611ae4253ff01762f9bda1d93620edf8f9a3b22'
28+

environment.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
modulepath = modules:site:$basemodulepath
2+
config_version = 'scripts/config_version.sh $environmentpath $environment'
3+
4+
# Environment timeout should be set to unlimited. When set to zero it is less performant.
5+
# When code is deployed the admin API of puppetserver should be used to force a refresh of code from disk.
6+
# https://docs.puppetlabs.com/puppetserver/1.0/release_notes.html#new-feature-admin-api-for-refreshing-environments
7+
# https://docs.puppetlabs.com/puppet/3.7/reference/environments_configuring.html#environmenttimeout
8+
environment_timeout = 0

hieradata/common.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
message: "This node is using common data"

scripts/config_version.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'rugged'
2+
3+
environmentpath = ARGV[0]
4+
environment = ARGV[1]
5+
6+
repo = Rugged::Repository.discover(File.join(environmentpath, environment))
7+
head = repo.head
8+
9+
#sha1 hash of the newest commit
10+
head_sha = head.target_id
11+
12+
#the commit message associated the newest commit
13+
commit = repo.lookup(head_sha)
14+
15+
#add something to find the remote url
16+
17+
puts head_sha

scripts/config_version.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
if [ -e /opt/puppetlabs/server/pe_version ]
3+
then
4+
/opt/puppetlabs/puppet/bin/ruby $1/$2/scripts/config_version.rb $1 $2
5+
else
6+
/usr/bin/git --git-dir $1/$2/.git rev-parse HEAD
7+
fi

0 commit comments

Comments
 (0)