Ask Your Question
3

how to recover from client bucket?

asked 2012-12-19 16:36:43 -0500

asq gravatar image

updated 2012-12-19 16:38:16 -0500

ok, so i screwed up and run puppet and now configuration is broken. still, it's puppet, so i have a chance to recover. usually in that case i login to affected node and do:

find /var/lib/puppet/clientbucket -cmin -60 -type f -name path|xargs grep -l /etc/file.i.need.back

and copy over accompanying contents file.

but this is hack, and there must be a better way to do this like

  1. fuse bucketfs
  2. storing buckets in git
  3. puppet face/api to do this

does anyone already have solution to share?

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
1

answered 2015-07-01 10:05:49 -0500

asq gravatar image

i'm back after a short intermission and answering myself :)

Ruby script for interactively restoring files from a Puppet client's clientbucket.

If you've accidently overwritten, with Puppet, a file you meant to keep, then this script can get it back. The real filebucket stuff provided by Puppetlabs requires the md5 of the old file you want to restore. This script goes and looks for all the available versions of a file, and allows you to diff, view, or restore one or more of these older versions.

https://github.com/andytinycat/puppet-clientbucket-restore

edit flag offensive delete link more

Comments

If you have upgraded to puppet 4, here is an updated version that allows you to point to the new path: https://github.com/rilindo/puppet-clientbucket-restore

rilindo gravatar imagerilindo ( 2016-05-20 22:14:35 -0500 )edit
3

answered 2012-12-20 21:38:58 -0500

llowder gravatar image

From looking at the documentation, you should be able to use puppet filebucket get <MD5sum> or puppet filebucket restore /path/to/file <MD5sum>

You do have to know the MDsum, but that easy to get using Dashboard and possibly Foreman, and this info may also be available in logs or reports.

edit flag offensive delete link more

Comments

it always says ``file not found'', but it might be just me :)

asq gravatar imageasq ( 2012-12-21 04:00:05 -0500 )edit
2

answered 2015-07-02 18:37:16 -0500

pizzaops gravatar image

Here's a puppet bucket face that makes it REALLLLLLY easy: https://github.com/dhgwilliam/puppet-...

Note that there is no official solution from Puppet Labs that makes it easy — only some third party tooling random folks have created.

That being said, I usually try to push people towards not using the filebucket. If you need backup, implement a backup solution :)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-12-19 16:36:43 -0500

Seen: 4,756 times

Last updated: Jul 02 '15