If you want to check whether a node run_list
includes a specific role (upon
expansion), then you could use role? method on the Node
object:
node.role?('name')
Alternatively, you can see whether either would work for you:
node.roles.include?('name')
node.run_list?('role[name]')