FAQ
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+unsubscribe@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.

Search Discussions

  • Felix Frank at Mar 26, 2015 at 5:45 pm

    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+unsubscribe@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.
  • Peter Berghold at Mar 26, 2015 at 6:39 pm
    Actually I made a typo and the segment of code that should have exported a
    resource was never invoked. When I fixed the typo I know get:

    Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
    Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
    resource type remotemaster at
    /etc/puppet/environments/POC/modules/puppet/manifests/master.pp:106 on node
    mtinjacn02.nvp.cip.att.com
    Warning: Not using cache on failed catalog
    Error: Could not retrieve catalog; skipping run

    "remotemaster" is the define I put together using the pattern
    define registerhost() {
              include parms
              concat::fragment("$fqdn fragment":
                    content => "${fqdn}",
                    target=>"${parms::filenmae}"
               }
    }


    I guess you can't export such a thing?

    On Thu, Mar 26, 2015 at 1:46 PM Felix Frank wrote:
    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+unsubscribe@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.
    --
    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+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAArvnv0DR0U--NvE%3DDqFc4knZbq9b-QN1gEBefjXGqrZgZ0HKA%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Felix Frank at Mar 26, 2015 at 8:07 pm

    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+unsubscribe@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.
  • Peter Berghold at Mar 26, 2015 at 8:47 pm
    puppetdbquery looks worth looking into...
    On Thu, Mar 26, 2015 at 4:07 PM Felix Frank 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+unsubscribe@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+unsubscribe@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.
  • Peter Berghold at Mar 26, 2015 at 8:58 pm
    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 wrote:

    puppetdbquery looks worth looking into...

    On Thu, Mar 26, 2015 at 4:07 PM Felix Frank <
    felix.frank@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+unsubscribe@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+unsubscribe@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.
  • Jeffrey Watts at Mar 26, 2015 at 10:18 pm
    Put the puppetdb directory in /etc/puppet/modules.

    Good luck.
    Jeffrey.
    On Thu, Mar 26, 2015 at 3:58 PM, Peter Berghold 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+unsubscribe@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.
  • Peter Berghold at Mar 26, 2015 at 10:36 pm
    Ok... I thought so... thanks
    On Thu, Mar 26, 2015, 18:18 Jeffrey Watts wrote:

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

    Good luck.
    Jeffrey.

    On Thu, Mar 26, 2015 at 3:58 PM, Peter Berghold 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+unsubscribe@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=email&utm_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+unsubscribe@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.
  • Jeffrey Watts at Mar 26, 2015 at 6:59 pm

    On Thu, Mar 26, 2015 at 11:29 AM, Peter Berghold 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+unsubscribe@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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedMar 26, '15 at 4:29p
activeMar 26, '15 at 10:36p
posts9
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase