get list of all nodes in site.pp and use it in another module

52 views
Skip to first unread message

sasikiran v

unread,
Nov 22, 2013, 8:04:03 AM11/22/13
to puppet...@googlegroups.com
How to use pupppet to get all the list of node names available in site.pp and use it in another module which is imported in site.pp


For example

site.pp
---------
node1 { 'first_node':
   a => 'hello'
  }


node2 { 'second_node':
  b => 'hai'
}


import new_module.pp


new_module.pp
----------------------

// Here i want to get all the list of node_names, is there any possibility to retrieve

Felix Frank

unread,
Nov 25, 2013, 11:03:51 AM11/25/13
to puppet...@googlegroups.com
Hi,

On 11/22/2013 02:04 PM, sasikiran v wrote:
> site.pp
> ---------
> node1 { 'first_node':
> a => 'hello'
> }

this doesn't look like valid node syntax?

> new_module.pp
> ----------------------
>
> // Here i want to get all the list of node_names, is there any
> possibility to retrieve

Uhm, you can *possibly* get at the data using file() or generate(), but
you probably shouldn't. It sounds like you are laying a nightmarish
foundation for your architecture.

What are you trying to do, specifically? Maybe we can recommend a better
way to get there.

Cheers,
Felix

●๋•کáکíkíŕáńツ

unread,
Nov 25, 2013, 11:46:08 AM11/25/13
to puppet...@googlegroups.com
Hi Felix,

I think the question which i asked didn't make sense.

I am new to puppet, basically i don't have basics on how the things like node, class, define works,
Is there any video tutorials avaiable to get through the puppet easily.

Thanks,
Sasikiran



--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/529374E7.6090504%40alumni.tu-berlin.de.

Felix Frank

unread,
Nov 25, 2013, 11:56:05 AM11/25/13
to puppet...@googlegroups.com
Hi,

I know of no video, but it's hard to convey the basics in such a form
anyway, I believe.

I recommend taking a look at the official tutorial:
http://docs.puppetlabs.com/learning/

Regards,
Felix
Reply all
Reply to author
Forward
0 new messages