[chef] automatically updating attributes visible to all nodes


Chronological Thread 
  • From:
  • To: chef < >
  • Subject: [chef] automatically updating attributes visible to all nodes
  • Date: Thu, 9 Feb 2012 10:57:19 -0800


hi. i'm trying to figure out how i can inform my monitored clients of
their monitoring server's IP for their config, especially when that
IP changes due to relaunching the mon server.

the answer might be to use databags. i note today's thread
"[chef]  passing attributes to recipes". but lemme talk it out:

at the moment, i supply a default attr mon_srv_ips in an environment
(i could also do this in role[base]). my clients' grab that IP attr
and put it into their config via a template:

  monserver=<%= node.mon.mon_srv_ips.join(',') %>

one day i'll relaunch the mon server, it'll get a new IP, and i'll have
to update the attr by hand (i think) in the environment file or
role[base].

but what if that new mon server could populate that IP attr with its
IP when it comes up? i can write the mon server recipe to write the IP
to a databag. then the clients could pull that from the databag, rather
than the env or role[base].

is using a databag for this the right thing? is there some other (better?)
way for this mon server to push an attr into something that is visible
by all my clients? can a node push attrs to and environment or role?

thankee,
kallen




Archive powered by MHonArc 2.6.16.

§