summaryrefslogtreecommitdiffstats
path: root/lib/puppet/server
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-04 22:23:08 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-04 22:23:08 +0000
commitd8b4b0dbf35b2b183cd62adf591ebf4650448a0d (patch)
treed51d99be35d0702ffc08bd0e8a28e82d8daf2e6b /lib/puppet/server
parentc0a9e5f2e9df8e6e1aed74653ae675029af8a9bb (diff)
downloadpuppet-d8b4b0dbf35b2b183cd62adf591ebf4650448a0d.tar.gz
puppet-d8b4b0dbf35b2b183cd62adf591ebf4650448a0d.tar.xz
puppet-d8b4b0dbf35b2b183cd62adf591ebf4650448a0d.zip
adding -e ability to puppet executable
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1065 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/server')
-rw-r--r--lib/puppet/server/master.rb23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/puppet/server/master.rb b/lib/puppet/server/master.rb
index 07a476efd..7e719452f 100644
--- a/lib/puppet/server/master.rb
+++ b/lib/puppet/server/master.rb
@@ -35,10 +35,14 @@ class Server
end
def initialize(hash = {})
- # FIXME this should all be s/:File/:Manifest/g or something
- # build our AST
- @file = hash[:File] || Puppet[:manifest]
- hash.delete(:File)
+ args = {}
+
+ # Allow specification of a code snippet or of a file
+ if code = hash[:Code]
+ args[:Code] = code
+ else
+ args[:Manifest] = hash[:Manifest] || Puppet[:manifest]
+ end
if hash[:Local]
@local = hash[:Local]
@@ -52,19 +56,18 @@ class Server
@ca = nil
end
- @parsecheck = hash[:FileTimeout] || 15
+ args[:ParseCheck] = hash[:FileTimeout] || 15
Puppet.debug("Creating interpreter")
- args = {:Manifest => @file, :ParseCheck => @parsecheck}
-
if hash.include?(:UseNodes)
args[:UseNodes] = hash[:UseNodes]
elsif @local
args[:UseNodes] = false
end
- # This is only used by the cfengine module
+ # This is only used by the cfengine module, or if --loadclasses was specified
+ # in +puppet+.
if hash.include?(:Classes)
args[:Classes] = hash[:Classes]
end
@@ -110,7 +113,9 @@ class Server
clientip = facts["ipaddress"]
end
- Puppet.notice("Compiling configuration for %s" % client)
+ unless @local
+ Puppet.notice("Compiling configuration for %s" % client)
+ end
begin
retobjects = @interpreter.run(client, facts)
rescue Puppet::Error => detail