diff options
author | Luke Kanies <luke@madstop.com> | 2009-08-01 12:45:55 -0700 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-08-02 17:37:27 +1000 |
commit | 7e5b56212eef22be381a480dcaf38b33620674dd (patch) | |
tree | 1315c26a67e3d84f87830dacab726ea30ce818af /spec/integration | |
parent | 97274ad976e3584ae850ad91cc886fae1dcdbbc6 (diff) | |
download | puppet-7e5b56212eef22be381a480dcaf38b33620674dd.tar.gz puppet-7e5b56212eef22be381a480dcaf38b33620674dd.tar.xz puppet-7e5b56212eef22be381a480dcaf38b33620674dd.zip |
Adding #2477 - puppet can apply provided catalogs
This provides the other half of #2440 - you can
compile catalogs into json with puppetmasterd,
and now you can take those json catalogs and apply
them.
This allows you to use whatever mechanism you want
to ship the catalogs around.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/integration')
-rwxr-xr-x | spec/integration/application/puppet.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/integration/application/puppet.rb b/spec/integration/application/puppet.rb new file mode 100755 index 000000000..0047dd5a3 --- /dev/null +++ b/spec/integration/application/puppet.rb @@ -0,0 +1,30 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../../spec_helper' + +require 'puppet_spec/files' + +require 'puppet/application/puppet' + +describe "Puppet" do + include PuppetSpec::Files + + it "should be able to apply catalogs provided in a file in json" do + file_to_create = tmpfile("json_catalog") + catalog = Puppet::Resource::Catalog.new + resource = Puppet::Resource.new(:file, file_to_create, :content => "my stuff") + catalog.add_resource resource + + manifest = tmpfile("manifest") + + File.open(manifest, "w") { |f| f.print catalog.to_json } + + puppet = Puppet::Application[:puppet] + puppet.options[:catalog] = manifest + + puppet.apply + + File.should be_exist(file_to_create) + File.read(file_to_create).should == "my stuff" + end +end |