Ask Your Question
1

How to collect data from nodes?

asked 2013-09-30 04:46:24 -0600

deric gravatar image

I'd like to collect ip addresses from all nodes that installed my module and concat then into one string. Something like this:

$hosts = "192.168.1.1:1234,192.168.1.2:1234"

How to implement it in puppet?

edit retag flag offensive close merge delete

Comments

rahul khengare gravatar imagerahul khengare ( 2013-10-01 02:08:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-09-30 09:05:41 -0600

GregLarkin gravatar image

Do you need to use the value of $hosts within Puppet itself, or will it be stored externally somewhere? I suggest having a look at the PuppetDB query API ( http://docs.puppetlabs.com/puppetdb/1.4/api/query/v2/resources.html ) to retrieve resources associated with nodes.

edit flag offensive delete link more

Comments

Hi, does Puppet have an API that could be used to act as a data source so that it could feed our Configuration Management tool (https://www.interlinksoftware.com/configuration-management/)

lbhopkins gravatar imagelbhopkins ( 2013-09-30 09:47:58 -0600 )edit

Puppet has a couple of APIs, and I believe what I heard at PuppetConf was they plan to consolidate them eventually. The first one is the PuppetDB API that I ...(more)

GregLarkin gravatar imageGregLarkin ( 2013-09-30 12:47:10 -0600 )edit

Thanks, it should be used in puppet module. I have a master and a few slaves. The master should have a list of all connected slaves. Is there a way ...(more)

deric gravatar imagederic ( 2013-10-09 06:50:28 -0600 )edit

Query this endpoint in the API (http://docs.puppetlabs.com/puppetdb/1.5/api/query/v3/resources.html#get-v3resourcestype), and that will give you a list of a nodes using ...(more)

GregLarkin gravatar imageGregLarkin ( 2013-10-09 12:42:14 -0600 )edit

Ok, I thought that there would be some internal function to do that. Then probably parse the response with custom ruby function, right?

deric gravatar imagederic ( 2013-10-09 13:08:42 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-09-30 04:46:24 -0600

Seen: 247 times

Last updated: Sep 30 '13