"Multinode" attributes, e.g.: fodder for /etc/hosts file


#1

I think it would not be appropriate to invade a recipe’s attributes with
implementation-specific detail such as a list of nodes by IP address and
name for the purpose of updating each node’s /etc/hosts file.

Instead, this information would be a resource stored where? Accessed
from the recipe how?

The specific case to hand is a MongoDB replica set. Each node must know
the hostname of all its sibling replica nodes. If this proves too messy,
I could just use IP addresses when I erect the replica set using the
MongoDB shell.

I’d appreciate a comment or two about this sort of thing, or a link to
some doc. I’ve read Seth Vargo’s post on managing the /etc/hosts file
with Chef, so I know there are cool tools for mucking about with this
file if I need to, I just don’t know where to store the list of IP
addresses-to-names for recipe access.

Many thanks.


#2

On Sep 5, 2013, at 5:44 PM, Russell Bateman russ@windofkeltia.com wrote:

Instead, this information would be a resource stored where? Accessed from the recipe how?

The specific case to hand is a MongoDB replica set. Each node must know the hostname of all its sibling replica nodes. If this proves too messy, I could just use IP addresses when I erect the replica set using the MongoDB shell.

This is where you use node attributes and search. There are existing community cookbooks that do exactly this sort of thing with mongodb.


Brad Knowles brad@shub-internet.org
LinkedIn Profile: http://tinyurl.com/y8kpxu