On 4/19/18 4:46 AM, Thomas Müller wrote:
HI
I've got some prod puppetserver/puppetdb and some dev
puppetserver/puppetdb. But to have the complete overview over all
nodes with the prod puppetdb I'd like to import the reports from the
dev puppetserver (stored by reports=store config) into the prod puppetdb.
is there some hidden tool to do so? I wasn't able to find anything in
that direction.
Reading
https://github.com/puppetlabs/puppetdb/blob/master/puppet/lib/puppet/reports/puppetdb.rb
this could maybe adapted to read a yaml file and then send it to puppetdb.
If I'm understanding you right, you could normally use the import/export
tools for this:
https://puppet.com/docs/puppetdb/5.0/anonymization.html#using-the-export-command
There's a corresponding "admin" API on PuppetDB you can search for. The
process would be to do an export, extract the resulting tarball and
remove everything but reports (if desired), then tar it up again and run
it through the import tool. Unfortunately though, this is broken for me
on current PDB due to PDB-3796. If you're on an older version it may be
worth a try -- it worked at some point. If you've got the bug it'll
cause your dev server to OOM and restart.
Assuming that's broken for you too, I think the most tractable way to do
what you're asking is basically what you're suggesting -- either parse
the yaml reports into the report wire format
(https://puppet.com/docs/puppetdb/5.1/api/wire_format/report_format_v8.html)
and post to your prod PDB's commands endpoint
(https://puppet.com/docs/puppetdb/5.1/api/command/v1/commands.html) or
get the json reports out of your dev PuppetDB, in batches to work around
the bug, and do the equivalent parsing/posting. The wire formats change
from time to time so take care to use whatever version of the docs
aligns with your PDB version.
Wyatt
- Thomas
--
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
<mailto:puppet-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/d5a3b811-655f-4497-84de-a5693954d08e%40googlegroups.com
<https://groups.google.com/d/msgid/puppet-users/d5a3b811-655f-4497-84de-a5693954d08e%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/ae2bf29b-c3e5-c0cf-8bff-a75258cad299%40gmail.com.
For more options, visit https://groups.google.com/d/optout.