hiera compatible refactoring
This commit is contained in:
@@ -1,20 +1,16 @@
|
||||
class puppet::facter (
|
||||
$ensure = 'present') {
|
||||
$pkg_ens = $ensure ? {
|
||||
'present' => 'latest',
|
||||
default => $ensure,
|
||||
}
|
||||
|
||||
package { 'facter': ensure => $ensure }
|
||||
|
||||
package { 'libaugeas-ruby': }
|
||||
$ens_dir = $ensure ? {
|
||||
'present' => 'directory',
|
||||
default => $ensure,
|
||||
'absent' => 'absent',
|
||||
default => 'directory',
|
||||
}
|
||||
|
||||
$facts_d = '/etc/facter/facts.d'
|
||||
|
||||
File['/etc/facter'] -> File[$facts_d]
|
||||
|
||||
$pv_dir = $::puppet_vardir ? {
|
||||
'' => '/var/lib/puppet',
|
||||
default => $::puppet_vardir
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
class puppet (
|
||||
$ensure = 'present',
|
||||
$version = undef,
|
||||
$pupppetlabs_apt = true,
|
||||
$agent = true,
|
||||
$server = false,
|
||||
$facter_version = $ensure,
|
||||
$puppetlabs_apt = true,
|
||||
$agent_norunifloggedin = false,
|
||||
$agent_daemonize = true,
|
||||
$agent_run_hour = '*/1',
|
||||
$agent_run_minute = '10',
|
||||
$agent_run_if_ipmatch = '',
|
||||
$agent_maxsleep = '3200',
|
||||
$server = false,
|
||||
$server_dns_alt_names = undef,
|
||||
$server_storeconfigs = false,
|
||||
$server_storeconfigs_backend = undef,
|
||||
@@ -17,7 +18,7 @@ class puppet (
|
||||
$server_reports = 'store',
|
||||
$server_passenger = true) {
|
||||
if $puppetlabs_apt {
|
||||
require 'puppet::puppetlabs_apt'
|
||||
class { 'puppet::puppetlabs_apt': before => Class['puppet::facter'] }
|
||||
}
|
||||
|
||||
if $version != undef {
|
||||
@@ -29,7 +30,15 @@ class puppet (
|
||||
}
|
||||
|
||||
class { 'puppet::facter':
|
||||
ensure => $ensure,
|
||||
ensure => $facter_version,
|
||||
}
|
||||
|
||||
ini_setting { 'puppet-templatedir':
|
||||
path => '/etc/puppet/puppet.conf',
|
||||
section => 'main',
|
||||
setting => 'templatedir',
|
||||
value => '$confidr/templates',
|
||||
ensure => 'absent';
|
||||
}
|
||||
|
||||
if $agent {
|
||||
|
||||
@@ -11,32 +11,21 @@ factsignore = .svn CVS .git
|
||||
pluginsync=true
|
||||
factpath=$vardir/lib/facter
|
||||
|
||||
<% if (fqdn == scope.lookupvar("puppetmaster_server")) || (fqdn == scope.lookupvar("puppetmasterdev_server")) -%>
|
||||
#dbmigrate=true
|
||||
#dbadapter=<%= scope.lookupvar('puppetmaster_dbtype') %>
|
||||
#dbname=<%= scope.lookupvar('puppetmaster_dbname') %>
|
||||
#dbserver=<%= scope.lookupvar('puppetmaster_dbhost') %>
|
||||
#dbuser=<%= scope.lookupvar('puppetmaster_dbuser') %>
|
||||
#dbpassword=<%= scope.lookupvar('puppetmaster_dbpassword') %>
|
||||
|
||||
<% if server == "true" -%>
|
||||
[master]
|
||||
ssl_client_header = SSL_CLIENT_S_DN
|
||||
ssl_client_verify_header = SSL_CLIENT_VERIFY
|
||||
<% if scope.lookupvar('puppet::puppetmaster::dns_alt_names') -%>
|
||||
dns_alt_names=<%= scope.lookupvar('puppet::puppetmaster::dns_alt_names') %>
|
||||
<% if scope['puppet::dns_alt_names'] -%>
|
||||
dns_alt_names=<%= scope['puppet::dns_alt_names'] %>
|
||||
<% end -%>
|
||||
<% if @reports -%>
|
||||
reports=<%= @reports %>
|
||||
<% if scope['puppet::reports'] -%>
|
||||
reports=<%= scope['puppet::reports'] %>
|
||||
<% end -%>
|
||||
<% if scope.lookupvar('puppetmaster_reporturl') != false -%>
|
||||
reporturl=<%= scope.lookupvar('puppetmaster_reporturl') %>
|
||||
basemodulepath=<%= scope['puppet::basemodulepath'] %>
|
||||
storeconfigs=<%= scope['puppet::storeconfigs'] %>
|
||||
<% if scope['puppet::storeconfigs_backend'] -%>
|
||||
storeconfigs_backend=<%= scope['puppet::storeconfigs_backend'] %>
|
||||
<% end -%>
|
||||
modulepath=<%= scope['puppet::puppetmaster::modulepath'] %>
|
||||
storeconfigs=<%= scope['puppet::puppetmaster::storeconfigs'] %>
|
||||
<% if scope['puppet::puppetmaster::storeconfigs_backend'] -%>
|
||||
storeconfigs_backend=<%= scope['puppet::puppetmaster::storeconfigs_backend'] %>
|
||||
<% end -%>
|
||||
#rails_loglevel=info
|
||||
<% end -%>
|
||||
|
||||
[agent]
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# $Id: puppetd_run.sh.erb 4177 2011-04-05 08:02:08Z uwaechte $
|
||||
|
||||
# a wrapper script, to run puppetd after a random time
|
||||
# this will be called by cron at the same time on each client,
|
||||
# but should not call the master at the same time as the others.
|
||||
|
||||
<% if norunifloggedin == true -%>
|
||||
<% if @norunifloggedin == true -%>
|
||||
# not running if users are logged in
|
||||
[[ $(who|wc -l) -gt 0 ]] && exit 0
|
||||
<% end -%>
|
||||
|
||||
export FACTERLIB="<%= scope.lookupvar("factpath") %>"
|
||||
#export FACTERLIB="<%= scope.lookupvar("factpath") %>"
|
||||
PATH="/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
PUPPET=$(which puppet)
|
||||
[[ -e ${PUPPET} ]] || exit 1
|
||||
PUPPET="${PUPPET}"
|
||||
<% if run_if_ipmatch != "" -%>
|
||||
ISUNIIP=$(ifconfig |grep -c -e "<%= run_if_ipmatch %>")
|
||||
<% if @run_if_ipmatch != "" -%>
|
||||
ISUNIIP=$(ifconfig |grep -c -e "<%= @run_if_ipmatch %>")
|
||||
<% else -%>
|
||||
ISUNIIP=1
|
||||
<% end -%>
|
||||
@@ -54,7 +53,7 @@ if [ ${ISUNIIP} -gt 0 ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
MAXSLEEP=<%= maxsleep %> #How many seconds to wait maximally
|
||||
MAXSLEEP=<%= @maxsleep %> #How many seconds to wait maximally
|
||||
SLEEP=${RANDOM}
|
||||
I=${RANDOM}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user