[chef] Q about accessing variables from other recipe and splitting attribute files by folders


Chronological Thread 
  • From: Daniil S < >
  • To: " " < >
  • Subject: [chef] Q about accessing variables from other recipe and splitting attribute files by folders
  • Date: Fri, 7 Nov 2014 14:22:29 +0000 (UTC)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=EK2rj2ejDLP64s78rcfAJa6X/htuy42YlPNjtyhw+truNV8dkCSLYuS9i58nLXcpfo4Sjf6GoG0UW5FTo8vrOxgEMUM7/y3tuFTOLOg9e6IivXXKILMqvHLQ6kZ+iSEtRQFm2m18/00gkDXIHlPSJqBRcwvwB9cpawHErOesg5G+NvnMeqHGtTO/xO9o1Kxe/YCFc3jv1u8S7vJf7YSDMgR6hMHotV3990r/JZJmXivuQ/szrohyvbK94arIUL7JXBjFcW3aAFNUi7qSeKXDT2BdtsJ4IMUdK6/S9Ii8VZ9c6xGXrOYp3wofpzeUiiAi8E2n1XsMc2EVE2Wzt25X6g==;

Hello.

I would be grateful if you answer a couple questions.

1. Is it possible to access variables defined in one recipe from the other? For example:

cookbooks/cookbook_name/default.rb:
    foo = :bar

cookbooks/cookbook_name/somerecipe.rb:
    template syspath do
      source repopath
      variables( :params => foo )
    end

2. Is it possible to load attributes from files located in subdirectory of attribute folder? For example:

cookbooks/
|-cookbook_name/
||-attributes/
||-default.rb
|||-attribute_folder1/
||||-one_more_attribute_file.rb
|||-attribute_folder2/
||||-one_more_attribute_file.rb

--
Thanks in advance, Daniil.




Archive powered by MHonArc 2.6.16.

§