Created
August 2, 2012 12:40
-
-
Save miketheman/3236753 to your computer and use it in GitHub Desktop.
CHEF-3345 Repro
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 'chef/role' | |
# The gist files name role-* should be moved into a directory named 'roles'. | |
role_path = Chef::Config[:role_path] = "./roles" | |
Dir.glob(File.join(role_path, '*.{rb,json}')) do |role_file| | |
rolefilename = File.basename(role_file, File.extname(role_file)) | |
role = Chef::Role.from_disk(rolefilename) | |
puts role.inspect | |
puts role.class | |
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
role[rbrole] | |
Chef::Role | |
{"name"=>"jsonrole", "description"=>"Sample json role", "run_list"=>["recipe[ntp]"]} | |
Hash |
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
{ | |
"name" : "jsonrole", | |
"description" : "Sample json role", | |
"run_list" : ["recipe[ntp]"] | |
} |
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
name "rbrole" | |
description "Some ruby role" | |
run_list("recipe[ntp]") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment