Created
December 9, 2010 21:13
-
-
Save jordansissel/735352 to your computer and use it in GitHub Desktop.
Exported resource querying in Ruby Puppet DSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "puppet/rails/resource" | |
hostclass :happy do | |
Puppet::Rails::Resource.find_all_by_restype("File").each do |r| #.find_all_by_restype("File").each do |r| | |
p r | |
end | |
end | |
node :default do | |
include "happy" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% puppet apply --storeconfig --dblocation /tmp/puppet.sqlite testpuppet.rb | |
#<Puppet::Rails::Resource id: 13, title: "/tmp/x", restype: "File", host_id: 1, source_file_id: 1, exported: true, line: 1, updated_at: "2010-12-09 13:13:03", created_at: "2010-12-09 13:13:03"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% puppet --storeconfigs --dblocation /tmp/puppet.sqlite -e '@@file { "/tmp/x": content => "Hello world\n"; }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment