Skip to content

Instantly share code, notes, and snippets.

@slyness
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save slyness/f84a016afd43f2fdce36 to your computer and use it in GitHub Desktop.

Select an option

Save slyness/f84a016afd43f2fdce36 to your computer and use it in GitHub Desktop.
export a bunch of roles in json to files
%w( myrole
another
thisone
thatone
somany
roles ).each do |role|
puts "exporting: " + role + "\n"
content = `knife role show #{role} -F json | python -m json.tool`
File.write("/tmp/roles/#{role}.json", content)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment