summaryrefslogtreecommitdiffstats
path: root/lib/puppet.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-02 07:30:14 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-02 07:30:14 +0000
commit95856eaaf02361ff597ca2c85e51cf141fe81280 (patch)
treedb31ba74ce65523fa9dcd4d1cae0cd75c55a4395 /lib/puppet.rb
parentff1df8e1aef99dbdc222c5d5d808494fd08e7f83 (diff)
downloadpuppet-95856eaaf02361ff597ca2c85e51cf141fe81280.tar.gz
puppet-95856eaaf02361ff597ca2c85e51cf141fe81280.tar.xz
puppet-95856eaaf02361ff597ca2c85e51cf141fe81280.zip
Okay, Puppet is now almost entirely capable of configuring itself. I have not yet added the extra tests to puppetmasterd to make sure it can start as a normal user, and the executables still fail some simple tests because they are producing output when they start (I will get rid of the output), but overall things look pretty good.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@965 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet.rb')
-rw-r--r--lib/puppet.rb33
1 files changed, 19 insertions, 14 deletions
diff --git a/lib/puppet.rb b/lib/puppet.rb
index deb5abce3..a3ff166bc 100644
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@ -59,7 +59,11 @@ module Puppet
class DevError < Error; end
def self.name
- $0.gsub(/.+#{File::SEPARATOR}/,'')
+ unless defined? @name
+ @name = $0.gsub(/.+#{File::SEPARATOR}/,'').sub(/\.rb$/, '')
+ end
+
+ return @name
end
# the hash that determines how our system behaves
@@ -100,18 +104,9 @@ module Puppet
conf = "/etc/puppet"
var = "/var/puppet"
end
- self.setdefaults("puppet",
+ self.setdefaults(:puppet,
:confdir => [conf, "The main Puppet configuration directory."],
- :vardir => [var, "Where Puppet stores dynamic and growing data."]
- )
-
- # Define the config default.
- self.setdefaults(self.name,
- :config => ["$confdir/#{self.name}.conf",
- "The configuration file for #{self.name}."]
- )
-
- self.setdefaults("puppet",
+ :vardir => [var, "Where Puppet stores dynamic and growing data."],
:logdir => ["$vardir/log", "The Puppet log directory."],
:statedir => { :default => "$vardir/state",
:mode => 01777,
@@ -128,7 +123,7 @@ module Puppet
:desc => "Where lock files are kept."
},
:statefile => { :default => "$statedir/state.yaml",
- :mode => 0770,
+ :mode => 0660,
:owner => "$user",
:owner => "$group",
:desc => "Where puppetd and puppetmasterd store state associated
@@ -149,8 +144,18 @@ module Puppet
:genmanifest => [false,
"Whether to just print a manifest to stdout and exit. Only makes
sense when used interactively. Takes into account arguments specified
- on the CLI."]
+ on the CLI."],
+ :mkusers => [false,
+ "Whether to create the necessary user and group that puppetd will
+ run as."]
+ )
+
+ # Define the config default.
+ self.setdefaults(self.name,
+ :config => ["$confdir/#{self.name}.conf",
+ "The configuration file for #{self.name}."]
)
+
self.setdefaults("puppetmasterd",
:user => ["puppet", "The user puppetmasterd should run as."],
:group => ["puppet", "The group puppetmasterd should run as."],