Skip to content

Instantly share code, notes, and snippets.

@obazoud
Created March 18, 2015 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save obazoud/9aa1d005ce619ccea5e8 to your computer and use it in GitHub Desktop.
Save obazoud/9aa1d005ce619ccea5e8 to your computer and use it in GitHub Desktop.
Chef: Migrate role name with Knife
knife exec -E 'nodes.find("role:qwerty") { |node| new_run_list = node.run_list.map { |element| (element == "role[qwerty]") ? "role[azerty]" : element }; node.run_list.reset!(new_run_list); node.save; }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment