Node json in data_bags/node

16 views
Skip to first unread message

chengkai liang

unread,
Jan 7, 2015, 2:11:04 PM1/7/15
to littl...@googlegroups.com
Hi,

How does node attributes get generated in data_bags/node directory.  So I brought up an instance on AWS and its internal ip address is ip-172-31-9-146 (172.31.9.146), however, in the data_bags/node json file the ipaddress was 172.31.30.177.  I logged into this instance and ran ohai ipaddress returns 172.31.9.146.

How does 172.31.30.177 get written?

-Chengkai

Miquel Torres

unread,
Jan 8, 2015, 5:55:37 AM1/8/15
to littl...@googlegroups.com
Chef does an attribute merge before a configuracion run, for each
node. LittleChef simulates a Chef Server having merged attributes for
all nodes, using the node databag for search.

What does your node/<aws-node-fqdn>.json contain?
I guess on first run, "ohai ipaddress" was run, and out of several IPs
172.31.30.177 was thought to be the nodes's IP.
> --
> You received this message because you are subscribed to the Google Groups
> "littlechef" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to littlechef+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

chengkai liang

unread,
Jan 8, 2015, 9:49:49 AM1/8/15
to littl...@googlegroups.com
I think I figure out the what the problem is.  For the instance I brought up there's no DNS entry setup yet.  So each time if I restarted or recreated instances, the ip addresses change.  And littlechef seems to not update
ipaddress if node.json already have one.  Also the nodes have to be access by littlechef once in order to have ipaddress attribute written.

-Chengkai

Miquel Torres

unread,
Jan 8, 2015, 11:03:10 AM1/8/15
to littl...@googlegroups.com
Yeah, that must be it.

Chef basically requires to have functioning DNS, as it uses FQDNs as
node identifiers. From the Chef Server docs:

"""
ensure that each machine has the following installed and configured properly:

Hostnames — Ensure that all systems have properly configured
hostnames. The hostname for the Chef server must be a FQDN, including
the domain suffix, and must be resolvable. See Hostnames, FQDNs for
more information
FQDNs — Ensure that all systems have a resolvable FQDN
"""

http://docs.chef.io/install_server_pre.html#about-the-hostname

Cheers,
Miquel
Reply all
Reply to author
Forward
0 new messages