Default values for attributes


#1

Hello,

I installed chef recently and now I’m trying to learn best practices for using
it. I realized that using set and set_unless for attributes definition is not
so easy as I thought after reading documentation.

I’m trying to create cookbook for arno-iptables-firewall. I want to have port
22 opened by default and on some nodes to be able to change these ports. The
thing is that when I use set_unless(some_attribute) = [“22”] in attributes
definition in my cookbook and I later change these values in web ui, these
changes are overwritten during next chef-client run.

I found this explanation http://tickets.opscode.com/browse/CHEF-838 so I know
that default is not really default.

So my question is, is there any “best practise” to do what I need? Could I for
example use something like
set(…) if node[:network][:firewall].nil?

Thanks for any reply and for very promising server management tool

ares