summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-19 17:43:58 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-19 17:43:58 +0000
commit531136ef9ef7bfa1626fb967708e7289be7fb23e (patch)
treed117a6839de937c1a291aeec4d909666dae1f1be
parent0153a0618396847dc1ecb05be4745adad9c34a45 (diff)
downloadpuppet-531136ef9ef7bfa1626fb967708e7289be7fb23e.tar.gz
puppet-531136ef9ef7bfa1626fb967708e7289be7fb23e.tar.xz
puppet-531136ef9ef7bfa1626fb967708e7289be7fb23e.zip
Updating the config generation stuff a bit, mostly just cleanup, but also changing the servername fact to be the fqdn of the server.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2321 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--CHANGELOG11
-rwxr-xr-xbin/puppetd8
-rw-r--r--lib/puppet/network/client.rb1
-rw-r--r--lib/puppet/network/client/master.rb11
-rw-r--r--lib/puppet/network/handler/master.rb2
5 files changed, 23 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 09f74eb96..6ca0dc2f0 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,15 @@
0.22.2 (grover)
+ The 'notify' type now defaults to its message being the same as its name.
+
+ Reopening $stdin to read from /dev/null during execution, in hopes that
+ init scripts will stop hanging.
+
+ Changed the 'servername' fact set on the server to use the server's fqdn,
+ instead of the short-name.
+
+ Changing the location of the configuration cache. It now defaults to being
+ in the state directory, rather than in the configuration directory.
+
All parameter instances are stored in a single @parameters instance variable
hash within resource type instances. We used to use separate hashes for
each parameter type.
diff --git a/bin/puppetd b/bin/puppetd
index fac30f345..be8af2287 100755
--- a/bin/puppetd
+++ b/bin/puppetd
@@ -34,19 +34,19 @@
# configuration every 30 minutes.
#
# Some flags are meant specifically for interactive use -- in particular,
-# +test+ and +tag+ are useful. +test+ enables verobse logging, causes
+# +test+ and +tags+ are useful. +test+ enables verobse logging, causes
# the daemon to stay in the foreground, exits if the server's configuration is
# invalid (this happens if, for instance, you've left a syntax error on the
# server), and exits after running the configuration once (rather than hanging
# around as a long-running process).
#
-# +tag+ allows you to specify what portions of a configuration you want to apply.
+# +tags+ allows you to specify what portions of a configuration you want to apply.
# Puppet elements are tagged with all of the class or definition names that
-# contain them, and you can use the +tag+ flag to specify one of these names,
+# contain them, and you can use the +tags+ flag to specify one of these names,
# causing only configuration elements contained within that class or definition
# to be applied. This is very useful when you are testing new configurations --
# for instance, if you are just starting to manage +ntpd+, you would put all of
-# the new elements into an +ntpd+ class, and call puppet with +--tag ntpd+,
+# the new elements into an +ntpd+ class, and call puppet with +--tags ntpd+,
# which would only apply that small portion of the configuration during your
# testing, rather than applying the whole thing.
#
diff --git a/lib/puppet/network/client.rb b/lib/puppet/network/client.rb
index c08acabb1..13f1878fd 100644
--- a/lib/puppet/network/client.rb
+++ b/lib/puppet/network/client.rb
@@ -78,6 +78,7 @@ class Puppet::Network::Client
driverparam = self.class.drivername
if hash.include?(:Server)
args = {:Server => hash[:Server]}
+ @server = hash[:Server]
args[:Port] = hash[:Port] || Puppet[:masterport]
@driver = self.class.xmlrpc_client.new(args)
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb
index d568b8ae7..a75410256 100644
--- a/lib/puppet/network/client/master.rb
+++ b/lib/puppet/network/client/master.rb
@@ -174,8 +174,10 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
if self.objects or FileTest.exists?(self.cachefile)
if self.fresh?(facts)
Puppet.info "Config is up to date"
- unless self.objects
- oldtext = self.retrievecache
+ if self.objects
+ return
+ end
+ if oldtext = self.retrievecache
begin
@objects = YAML.load(oldtext).to_type
rescue => detail
@@ -278,7 +280,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
if FileTest.exists?(self.cachefile)
return ::File.read(self.cachefile)
else
- return ""
+ return nil
end
end
@@ -597,8 +599,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
fromcache = false
if textobjects == ""
- textobjects = self.retrievecache
- if textobjects == ""
+ unless textobjects = self.retrievecache
raise Puppet::Error.new(
"Cannot connect to server and there is no cached configuration"
)
diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb
index 2b0a215d0..c728638b2 100644
--- a/lib/puppet/network/handler/master.rb
+++ b/lib/puppet/network/handler/master.rb
@@ -24,7 +24,7 @@ class Puppet::Network::Handler
facts["serverversion"] = Puppet.version.to_s
# And then add the server name and IP
- {"servername" => "hostname",
+ {"servername" => "fqdn",
"serverip" => "ipaddress"
}.each do |var, fact|
if obj = Facter[fact]