henry.oswald
henry.oswald

Reputation: 5434

knife data bag from file - show what changed

When uploading a data bag to chef client is it possible to see what has changed, or what the difference is between a local file and the server?

Upvotes: 1

Views: 1343

Answers (2)

sethvargo
sethvargo

Reputation: 26997

You should use the knife diff command.

Docs: http://docs.opscode.com/knife_diff.html

Upvotes: 2

Display Name is missing
Display Name is missing

Reputation: 6227

To view what is currently on the server:

knife data bag show <name> <data bag id> --secret-file <path_to_key>

You can drop the secret-file portion if you're not encrypting your passwords. If you want to drop it out to a json file so you can do the diff yourself it's:

knife data bag show <name> <data bag id> --format json --secret-file <path_to_key> > /tmp/data_bag_contents.json

Upvotes: 0

Related Questions