Updating facts for a client in PuppetDB independently from the master

86 views
Skip to first unread message

Trevor Vaughan

unread,
Feb 17, 2016, 10:49:02 AM2/17/16
to puppet...@googlegroups.com
Hi All,

Is is possible to add facts to a client in PuppetDB independently of a run of Puppet on a client?

Basically, I need to add some data to the client runs but the data is irrelevant to the client itself so there's no need to shove it across the network multiple times.

I took a look at the API and it seems like I might have to use 'replace_facts' but I'd need to fetch the last fact set, update it, and then resubmit it with the updated information which isn't ideal but would be doable.

Thanks,

Trevor

--
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699

-- This account not approved for unencrypted proprietary information --

Thomas Müller

unread,
Feb 17, 2016, 4:28:47 PM2/17/16
to Puppet Users
wouldnt next puppet run replace your out of band added fact?

Trevor Vaughan

unread,
Feb 17, 2016, 4:34:13 PM2/17/16
to puppet...@googlegroups.com
Yeah, it would.

What I'm looking at doing would be injected as part of the reporting phase so it would be updated after each client run.

Not an ideal solution, I would much rather be able to add some extra metadata to my clients in PuppetDB instead of needing to drag around yet another database interface.

Thanks,

Trevor

On Wed, Feb 17, 2016 at 4:28 PM, Thomas Müller <tho...@chaschperli.ch> wrote:
wouldnt next puppet run replace your out of band added fact?

--
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/6c69c0c7-c433-434f-a9f2-faa6999bf4c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wyatt Alt

unread,
Feb 17, 2016, 4:42:46 PM2/17/16
to puppet...@googlegroups.com
On 02/17/2016 07:48 AM, Trevor Vaughan wrote:
>
>
> I took a look at the API and it seems like I might have to use
> 'replace_facts' but I'd need to fetch the last fact set, update it,
> and then resubmit it with the updated information which isn't ideal
> but would be doable.
>
>
This is your best bet unfortunately. There's no support for
nonoverwriting facts submission.

Wyatt

otheus uibk

unread,
Mar 27, 2016, 11:20:14 PM3/27/16
to Puppet Users
On Wednesday, February 17, 2016 at 10:34:13 PM UTC+1, Trevor Vaughan wrote:
Yeah, it would.

What I'm looking at doing would be injected as part of the reporting phase so it would be updated after each client run.

Not an ideal solution, I would much rather be able to add some extra metadata to my clients in PuppetDB instead of needing to drag around yet another database interface.

I spent a few hours verifying that what Wyatt Alt said is in fact the case. Fetch-all / modify JSON / add new fact / Put-all.

otheus uibk

unread,
Mar 27, 2016, 11:20:20 PM3/27/16
to Puppet Users
On Wednesday, February 17, 2016 at 10:34:13 PM UTC+1, Trevor Vaughan wrote:
Yeah, it would.

What I'm looking at doing would be injected as part of the reporting phase so it would be updated after each client run.

Not an ideal solution, I would much rather be able to add some extra metadata to my clients in PuppetDB instead of needing to drag around yet another database interface.


Except that on the next puppet run, puppet master will replace the facts with those it think should be yours. 

So basically, puppetdb is essentially a read-only datastore, not a db.
Reply all
Reply to author
Forward
0 new messages