Created
March 17, 2014 13:08
-
-
Save kwilczynski/9598879 to your computer and use it in GitHub Desktop.
Monkey-patch Chef::Node#role? method so it can search through an array.
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
class Chef | |
class Node | |
def role?(argument) | |
if argument.is_a? Array | |
argument.detect {|r| run_list.include? "role[#{r}]" } ? true : false | |
else | |
argument.include? "role[#{argument}]" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment