Method: Chef::Node#policy_name
- Defined in:
- lib/chef/node.rb
#policy_name(arg = NOT_PASSED) ⇒ String
The policy_name 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.
151 152 153 154 155 156 |
# File 'lib/chef/node.rb', line 151 def policy_name(arg = NOT_PASSED) return @policy_name if arg.equal?(NOT_PASSED) validate({ policy_name: arg }, { policy_name: { kind_of: [ String, NilClass ], regex: /^[\-:.[:alnum:]_]+$/ } }) @policy_name = arg end |