If you’d like to stick with 0.7.16, you can use set_unless to set the
attribute to an emtpy array if it doesn’t exist, then append a port to
the array with the << operator (or use the push or unshift methods).
There’s no way in 0.7.16 to ensure that a given set of attributes is
loaded before another, so you’ll want to put the set_unless in both
On Friday, January 29, 2010, Joshua Timberman email@example.com wrote:
-----BEGIN PGP SIGNED MESSAGE-----
We actually added a helper method to allow better management of this with CHEF-607:
So you can include another cookbooks attributes file to make sure that the attributes there are available in the current cookbook.
On Jan 29, 2010, at 2:44 AM, Ares wrote:
I’ve got two cookbooks, one is for managing firewall and second is for let’s
say apache for example. Firewall cookbook defines attribute :ports which is an
array of ports that should be open.
Is there any way how apache can add it’s :listen_port to array of :ports? It
should first verify, that attribute :ports exists then check whether the port
is already in array and finally add it if it’s missing.
Thanks for any reply
Joshua Timberman, Senior Solutions Engineer
C: 720.878.4322 E: firstname.lastname@example.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
-----END PGP SIGNATURE-----