Skip to content

Instantly share code, notes, and snippets.

LINT_IGNORES = ['rvm']
namespace :lint do
desc "Check puppet module code style."
task :ci do
begin
require 'puppet-lint'
rescue LoadError
fail 'Cannot load puppet-lint, did you install it?'
end
loggerFile = "logger.log"
warningLog = "puppet_error.log"
channel = manager.build.workspace.channel;
workspace = manager.build.workspace.toString();
result = manager.build.result
checkFile = new hudson.FilePath( channel, workspace + "/" + warningLog )
if ( !checkFile.exists() ) {
return true
[main]
# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet
# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet
modulepath = /etc/puppet/modules/internal:/etc/puppet/modules/external
foo::admin_user: "charlie"
class foo (
$admin_user = "default_user"
) {
file { "/var/foo.conf":
ensure => present,
content => template("foo/template.erb"),
}
}
admin_user: "charlie"
---
:backends:
- yaml
:hierarchy:
- %{::environment}
- common
:yaml:
:datadir: /etc/puppet/hieradata
class foo {
$admin_user = $environment ? {
"dev" => "alpha",
"stage" => "bravo",
default => "charlie"
}
file { "/var/foo.conf":
ensure => present,
content => template("foo/template.erb"),
}
class foo {
$admin_user = "alpha"
file { "/var/foo.conf":
ensure => present,
content => template("foo/template.erb"),
}
}
#!/bin/sh
# modules/your_module/files/hello_world.sh
while getopts f: option
do
case "${option}"
in
f) FOO=${OPTARG};;
esac
done