3

I saw this code at chef attributes file.

include_recipe "deployment"
include_attribute "postgresql"
include_attribute "redis"
include_attributes "uaa"
include_attributes "service_lifecycle"

What's different? include_attribute vs. include_attribute*S*

I cannot find any document about include_attribute*S*

plhn
  • 5,017
  • 4
  • 47
  • 47

2 Answers2

5

include_attribute attribute is used to order the way in which attributes file are loaded when converged.

If you need particular attributes loaded first, say in a wrapper cookbook you could use this to ensure precedence. This is chef 11 + only.

mmell
  • 2,448
  • 1
  • 24
  • 16
3

AFAIK there is no such thing as include_attributes. It does not do anything. Unfortunately it does not fail the chef run with some "Wrong Method" or "Cannot parse attributes" errors.

Draco Ater
  • 20,820
  • 8
  • 62
  • 86
  • Thank you for your answer but, how about this? https://github.com/cloudfoundry/vcap/blob/master/dev_setup/cookbooks/cloud_controller/attributes/default.rb – plhn Jan 30 '13 at 08:39
  • Cannot see it here: https://github.com/opscode/chef/blob/master/lib/chef/dsl/include_attribute.rb – Draco Ater Jan 30 '13 at 09:58
  • This is ancient but it's here: https://github.com/chef/chef/blob/master/lib/chef/dsl/include_attribute.rb – ZombieDev Apr 26 '17 at 18:40