Method: Chef::Node#policy_group

Defined in:
lib/chef/node.rb

#policy_group(arg = NOT_PASSED) ⇒ String

The policy_group for this node. Setting this to a non-nil value will enable policyfile mode when chef-client is run. If set in the config file or in node json, running chef-client will update this value.

Parameters:

  • arg (String) (defaults to: NOT_PASSED)

    the new policy_group value

Returns:

  • (String)

    the current policy_group, or the one you just set

See Also:



174
175
176
177
178
179
# File 'lib/chef/node.rb', line 174

def policy_group(arg = NOT_PASSED)
  return @policy_group if arg.equal?(NOT_PASSED)

  validate({ policy_group: arg }, { policy_group: { kind_of: [ String, NilClass ], regex: /^[\-:.[:alnum:]_]+$/ } })
  @policy_group = arg
end