Re: [Puppet Users] Creating a list of hosts

2015-03-26 Thread Felix Frank
On 03/26/2015 05:29 PM, Peter Berghold wrote:
 
 I watched the puppetdb log and it would seem something is being written
 to puppetdb and puppetdb is the backend for storeconfigs. 

Have you tried actually querying the PuppetDB contents?

https://docs.puppetlabs.com/puppetdb/latest/api/query/v2/resources.html

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/551445C5.7060102%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Creating a list of hosts

2015-03-26 Thread Peter Berghold
I need a push in the right direction.  I have a need to have a subset of
hosts in my environment register themselves to receive rsync updates from
a central host.  I realize that the right approach is exported resources
but I'm getting stuck on the actual implementation.

Here is what I tried:

in one module

define registerhost() {
 include parms
 concat::fragment($fqdn fragment:
   content = ${fqdn},
   target=${parms::filenmae}
  }
}

and elsewhere

@@registerhost {${fqdn}: }

and then to marshal the resources

concat { ${parms::filename}:
  ensure = present,
   backup= true,
   owner = root, group= root, mode = 0644
  }

  Registerhost ||

What I'm seeing is
/usr/local/etc/remote-masters.txt]/returns: The fragments directory is
empty, cowardly refusing to make empty config files


I watched the puppetdb log and it would seem something is being written to
puppetdb and puppetdb is the backend for storeconfigs.

so... suggestions?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAArvnv22a%3DOf_5XX%3DPocetco_pLKt89%3DHNsrhc5Fny5kgwhpRg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Creating a list of hosts

2015-03-26 Thread Felix Frank
On 03/26/2015 07:39 PM, Peter Berghold wrote:

 I guess you can't export such a thing?

You can. But your define is not called 'remotemaster'. Perhaps that is
the cause of the error.

Cheers,
Felix

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/551466F6.9090807%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Creating a list of hosts

2015-03-26 Thread Jeffrey Watts
On Thu, Mar 26, 2015 at 11:29 AM, Peter Berghold salty.cowd...@gmail.com
wrote:

 I need a push in the right direction.  I have a need to have a subset of
 hosts in my environment register themselves to receive rsync updates from
 a central host.  I realize that the right approach is exported resources
 but I'm getting stuck on the actual implementation.


Hi!  I'd recommend you look at the wonderful puppetdb-query:
https://github.com/dalen/puppet-puppetdbquery

I use it to extract hostnames from PuppetDB to populate various things.
It's been a long time since I set this up but it should be as simple as
installing the module and doing something like this:

manifests/init.pp:

   $all_hosts = query_nodes('kernel=Linux')

file { 'fqdns.txt':
  content   = template('test/fqdns.erb'),
  ensure= file,
  path   = '/foo/bar/fqdns',
}

templates/fqdns.erb:

%- all_hosts.each do |fqdn| -%
%= fqdn %
%- end -%

Hope this helps!
Jeffrey.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAMvPdm1yWn11x0KNf7CVwJ0hDG%3D%3DR4-Wo0po60a-hDH2Qsi90A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Creating a list of hosts

2015-03-26 Thread Jeffrey Watts
Put the puppetdb directory in /etc/puppet/modules.

Good luck.
Jeffrey.

On Thu, Mar 26, 2015 at 3:58 PM, Peter Berghold salty.cowd...@gmail.com
wrote:

 OK... excuse me for being a bit dense... but how do you install this
 thing?  i've unzipped it and it isn't very obvious to me...


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAMvPdm0pmOYTcVZqjJUxXAN553e%3DiRoXCfrxL-8kU9zeCx6DYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Creating a list of hosts

2015-03-26 Thread Peter Berghold
puppetdbquery looks worth looking into...

On Thu, Mar 26, 2015 at 4:07 PM Felix Frank felix.fr...@alumni.tu-berlin.de
wrote:

 On 03/26/2015 07:39 PM, Peter Berghold wrote:
 
  I guess you can't export such a thing?

 You can. But your define is not called 'remotemaster'. Perhaps that is
 the cause of the error.

 Cheers,
 Felix

 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/puppet-users/551466F6.9090807%40Alumni.TU-Berlin.de.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAArvnv2qBvKZUG9d_roD8XYAJpEZ8_xN-FPwEAZ6mwFGpTzgcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Creating a list of hosts

2015-03-26 Thread Peter Berghold
OK... excuse me for being a bit dense... but how do you install this thing?
 i've unzipped it and it isn't very obvious to me...

On Thu, Mar 26, 2015 at 4:47 PM Peter Berghold salty.cowd...@gmail.com
wrote:

 puppetdbquery looks worth looking into...

 On Thu, Mar 26, 2015 at 4:07 PM Felix Frank 
 felix.fr...@alumni.tu-berlin.de wrote:

 On 03/26/2015 07:39 PM, Peter Berghold wrote:
 
  I guess you can't export such a thing?

 You can. But your define is not called 'remotemaster'. Perhaps that is
 the cause of the error.

 Cheers,
 Felix

 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/ms
 gid/puppet-users/551466F6.9090807%40Alumni.TU-Berlin.de.
 For more options, visit https://groups.google.com/d/optout.



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAArvnv3PyH1qhj2m%2BSPB%2BwOqe09oVsHp%2Bq8XEc6NW3KOxH7iJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Creating a list of hosts

2015-03-26 Thread Peter Berghold
Ok... I thought so... thanks

On Thu, Mar 26, 2015, 18:18 Jeffrey Watts jeffrey.w.wa...@gmail.com wrote:

 Put the puppetdb directory in /etc/puppet/modules.

 Good luck.
 Jeffrey.


 On Thu, Mar 26, 2015 at 3:58 PM, Peter Berghold salty.cowd...@gmail.com
 wrote:

 OK... excuse me for being a bit dense... but how do you install this
 thing?  i've unzipped it and it isn't very obvious to me...


  --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/CAMvPdm0pmOYTcVZqjJUxXAN553e%3DiRoXCfrxL-8kU9zeCx6DYQ%40mail.gmail.com
 https://groups.google.com/d/msgid/puppet-users/CAMvPdm0pmOYTcVZqjJUxXAN553e%3DiRoXCfrxL-8kU9zeCx6DYQ%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAArvnv1txzeotzwEMg_yDVk0T%3DhYNnUJRMvvSkTN5g2N7HrgPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.