From 501cfbf10383b747e5d2ca4c3bedbc7efd6cda69 Mon Sep 17 00:00:00 2001 From: Brenton Leanhardt Date: Fri, 11 Jul 2008 17:19:30 -0400 Subject: Adding a genomerepo::client class for custom machine types --- .../genome_module/manifests/init.pp | 28 +++++++++- .../templates/puppet.conf.appliance.erb | 61 ++++++++++++++++++++++ .../genome_module/templates/puppet.conf.client.erb | 54 +++++++++++++++++++ .../genome_module/templates/puppet.conf.erb | 61 ---------------------- genome-repo/genome-repo.spec | 2 +- 5 files changed, 143 insertions(+), 63 deletions(-) create mode 100644 genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.appliance.erb create mode 100644 genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.client.erb delete mode 100644 genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.erb diff --git a/genome-repo/genome-repo-1.0.0/genome_module/manifests/init.pp b/genome-repo/genome-repo-1.0.0/genome_module/manifests/init.pp index c7fdaab..0a5dfa3 100644 --- a/genome-repo/genome-repo-1.0.0/genome_module/manifests/init.pp +++ b/genome-repo/genome-repo-1.0.0/genome_module/manifests/init.pp @@ -119,7 +119,7 @@ class genomerepo { file { "${puppetdir}/puppet.conf": mode => 0644, - content => template("genomerepo/puppet.conf.erb"), + content => template("genomerepo/puppet.conf.appliance.erb"), require => Package["puppet"], } @@ -259,6 +259,32 @@ class genomerepo { } } } + + # We need a least some way for custom machine types to configured puppetd + # out of the box. This class is available to any custom machine types. + # Note: This class is NOT compatible with the appliance class. + class client { + $puppetdir = "/etc/puppet" + + file { "${puppetdir}/puppet.conf": + mode => 0644, + content => template("genomerepo/puppet.conf.client.erb"), + require => Package["puppet"], + } + + package { "puppet": + ensure => installed, + } + + service { "puppet": + ensure => running, + enable => true, + hasrestart => true, + hasstatus => true, + require => File["${puppetdir}/puppet.conf"] + } + + } # This class needs to have some sort of auto backup support # since it will be more 'mission critical' diff --git a/genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.appliance.erb b/genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.appliance.erb new file mode 100644 index 0000000..d52986e --- /dev/null +++ b/genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.appliance.erb @@ -0,0 +1,61 @@ +[main] + # Where Puppet stores dynamic and growing data. + # The default value is '/var/puppet'. + vardir = /var/lib/puppet + + # 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 + + # Where SSL certificates are kept. + # The default value is '$confdir/ssl'. + ssldir = $vardir/ssl + + # sync plugins + pluginsync = true + + # the plugin path + pluginsignore = .svn .git CVS + pluginpath = $confdir/plugins + + # main module path + modulepath = $confdir/modules:<%= third_party_module_dir %> + +[development] + modulepath = $confdir/modules/dev:$confdir/modules/main:$confdir/modules +[qa] + modulepath = $confdir/modules/qa:$confdir/modules/main:$confdir/modules +[stage] + modulepath = $confdir/modules/stage:$confdir/modules/main:$confdir/modules + +[puppetd] + # The file in which puppetd stores a list of the classes + # associated with the retrieved configuratiion. Can be loaded in + # the separate ``puppet`` executable using the ``--loadclasses`` + # option. + # The default value is '$confdir/classes.txt'. + classfile = $vardir/classes.txt + + # Where puppetd caches the local configuration. An + # extension indicating the cache format is added automatically. + # The default value is '$confdir/localconfig'. + localconfig = $vardir/localconfig + + # our puppet server + server = <%= fqdn %> + # run every... in seconds + runinterval = 600 + # graphing + graph = true + # turn on reporting + report = true + # Ignore cache and always recompile the configuration. + ignorecache = true + +[puppetmasterd] + node_terminus = exec + external_nodes = /usr/local/bin/puppet_node.sh diff --git a/genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.client.erb b/genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.client.erb new file mode 100644 index 0000000..ce60154 --- /dev/null +++ b/genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.client.erb @@ -0,0 +1,54 @@ +[main] + # Where Puppet stores dynamic and growing data. + # The default value is '/var/puppet'. + vardir = /var/lib/puppet + + # 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 + + # Where SSL certificates are kept. + # The default value is '$confdir/ssl'. + ssldir = $vardir/ssl + + # sync plugins + pluginsync = true + + # the plugin path + pluginsignore = .svn .git CVS + pluginpath = $confdir/plugins + +[development] + modulepath = $confdir/modules/dev:$confdir/modules/main:$confdir/modules +[qa] + modulepath = $confdir/modules/qa:$confdir/modules/main:$confdir/modules +[stage] + modulepath = $confdir/modules/stage:$confdir/modules/main:$confdir/modules + +[puppetd] + # The file in which puppetd stores a list of the classes + # associated with the retrieved configuratiion. Can be loaded in + # the separate ``puppet`` executable using the ``--loadclasses`` + # option. + # The default value is '$confdir/classes.txt'. + classfile = $vardir/classes.txt + + # Where puppetd caches the local configuration. An + # extension indicating the cache format is added automatically. + # The default value is '$confdir/localconfig'. + localconfig = $vardir/localconfig + + # our puppet server + server = <%= repoappliance %> + # run every... in seconds + runinterval = 600 + # graphing + graph = true + # turn on reporting + report = true + # Ignore cache and always recompile the configuration. + ignorecache = true diff --git a/genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.erb b/genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.erb deleted file mode 100644 index d52986e..0000000 --- a/genome-repo/genome-repo-1.0.0/genome_module/templates/puppet.conf.erb +++ /dev/null @@ -1,61 +0,0 @@ -[main] - # Where Puppet stores dynamic and growing data. - # The default value is '/var/puppet'. - vardir = /var/lib/puppet - - # 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 - - # Where SSL certificates are kept. - # The default value is '$confdir/ssl'. - ssldir = $vardir/ssl - - # sync plugins - pluginsync = true - - # the plugin path - pluginsignore = .svn .git CVS - pluginpath = $confdir/plugins - - # main module path - modulepath = $confdir/modules:<%= third_party_module_dir %> - -[development] - modulepath = $confdir/modules/dev:$confdir/modules/main:$confdir/modules -[qa] - modulepath = $confdir/modules/qa:$confdir/modules/main:$confdir/modules -[stage] - modulepath = $confdir/modules/stage:$confdir/modules/main:$confdir/modules - -[puppetd] - # The file in which puppetd stores a list of the classes - # associated with the retrieved configuratiion. Can be loaded in - # the separate ``puppet`` executable using the ``--loadclasses`` - # option. - # The default value is '$confdir/classes.txt'. - classfile = $vardir/classes.txt - - # Where puppetd caches the local configuration. An - # extension indicating the cache format is added automatically. - # The default value is '$confdir/localconfig'. - localconfig = $vardir/localconfig - - # our puppet server - server = <%= fqdn %> - # run every... in seconds - runinterval = 600 - # graphing - graph = true - # turn on reporting - report = true - # Ignore cache and always recompile the configuration. - ignorecache = true - -[puppetmasterd] - node_terminus = exec - external_nodes = /usr/local/bin/puppet_node.sh diff --git a/genome-repo/genome-repo.spec b/genome-repo/genome-repo.spec index 9344295..64d5177 100644 --- a/genome-repo/genome-repo.spec +++ b/genome-repo/genome-repo.spec @@ -1,6 +1,6 @@ Name: genome-repo Version: 1.0.0 -Release: 34%{?dist} +Release: 35%{?dist} Summary: Genome repository Group: Applications/System -- cgit