Created
September 17, 2015 07:39
-
-
Save sawanoboly/10c60e01382efba3505a to your computer and use it in GitHub Desktop.
Role(Ruby DSL) with knife-zero.
This file contains hidden or 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
Dir.glob("roles/*.rb").each do |rf| | |
role = Chef::Role.new | |
role.name(File.basename(rf, ".rb")) | |
role.from_file(rf) | |
File.open(rf.gsub(".rb", ".json"),"w") {|f| f.puts(role.to_json)} | |
end | |
local_mode true | |
chef_repo_path File.expand_path("../", __FILE__) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment