Comparing local cookbooks to server

I’m wondering what you guys use to compare the versions of your local
cookbooks to what is on the server and in a specific environment. Seems
like there should be a knife plugin for this, but I couldn’t find one that
does this. The knife-env-diff plugin compares versions in two local env
files, but I didn’t see anything comparing local cookbook versions to env
files or what’s currently on the server. Should be pretty easy to whip up
a knife plugin for this, but I figured I’d ask before I bother writing one.

Thanks
John

Health Inspector is an awesome tool for keeping your local repo and the server in sync. It compares it all and looks at checksums so it's not just versions.

http://bmarini.github.com/health_inspector/

Tim Smith - Systems Engineer
m: +1 707.738.8132

On Feb 19, 2013, at 9:26 AM, John Alberts john.m.alberts@gmail.com wrote:

I'm wondering what you guys use to compare the versions of your local cookbooks to what is on the server and in a specific environment. Seems like there should be a knife plugin for this, but I couldn't find one that does this. The knife-env-diff plugin compares versions in two local env files, but I didn't see anything comparing local cookbook versions to env files or what's currently on the server. Should be pretty easy to whip up a knife plugin for this, but I figured I'd ask before I bother writing one.

Thanks
John

this is already included in chef 11, you have to install it separately if
you are on chef 10.x
regards
ranjib

On Tue, Feb 19, 2013 at 9:28 AM, Tim Smith tsmith@llnw.com wrote:

Health Inspector is an awesome tool for keeping your local repo and the
server in sync. It compares it all and looks at checksums so it's not just
versions.

http://bmarini.github.com/health_inspector/

[image: Limelight Networks] http://www.limelight.com/Tim Smith - Systems
Engineer
m: +1 707.738.8132

On Feb 19, 2013, at 9:26 AM, John Alberts john.m.alberts@gmail.com
wrote:

I'm wondering what you guys use to compare the versions of your local
cookbooks to what is on the server and in a specific environment. Seems
like there should be a knife plugin for this, but I couldn't find one that
does this. The knife-env-diff plugin compares versions in two local env
files, but I didn't see anything comparing local cookbook versions to env
files or what's currently on the server. Should be pretty easy to whip up
a knife plugin for this, but I figured I'd ask before I bother writing one.

Thanks
John

Haven't seen that before. Looks interesting, though, I see a problem with
using it along with knife-spork.

Assumptions

  • Your roles and environments are written using the ruby DSL.

knife-spork only works with json env files and it's engrained in my
workflow, so that's a no go for me unfortunatley.

On Tue, Feb 19, 2013 at 11:28 AM, Tim Smith tsmith@llnw.com wrote:

Health Inspector is an awesome tool for keeping your local repo and the
server in sync. It compares it all and looks at checksums so it's not just
versions.

http://bmarini.github.com/health_inspector/

[image: Limelight Networks] http://www.limelight.com/Tim Smith - Systems
Engineer
m: +1 707.738.8132

On Feb 19, 2013, at 9:26 AM, John Alberts john.m.alberts@gmail.com
wrote:

I'm wondering what you guys use to compare the versions of your local
cookbooks to what is on the server and in a specific environment. Seems
like there should be a knife plugin for this, but I couldn't find one that
does this. The knife-env-diff plugin compares versions in two local env
files, but I didn't see anything comparing local cookbook versions to env
files or what's currently on the server. Should be pretty easy to whip up
a knife plugin for this, but I figured I'd ask before I bother writing one.

Thanks
John

--
John Alberts

On Tue, Feb 19, 2013 at 11:29 AM, Ranjib Dey dey.ranjib@gmail.com wrote:

GitHub - jkeiser/knife-essentials: Knife commands to treat the Chef server like a filesystem

this is already included in chef 11, you have to install it separately if
you are on chef 10.x

I tried this yesterday, but I couldn't figure out the syntax to compare my
local cookbooks to what's currently on the server. Any ideas how to do
this?

--
John Alberts

I'm lazy, ahem, very busy so I'm still using a set of plugins that I wrote
some time ago: GitHub - andreacampi/knife-export-plugins: A set of export plugins for Chef's `knife`.

I'm not sure anymore that JSON is the right thing for me, but it may help
you :slight_smile:

On Tue, Feb 19, 2013 at 6:31 PM, John Alberts john.m.alberts@gmail.comwrote:

Haven't seen that before. Looks interesting, though, I see a problem with
using it along with knife-spork.

Assumptions

  • Your roles and environments are written using the ruby DSL.

knife-spork only works with json env files and it's engrained in my
workflow, so that's a no go for me unfortunatley.

On Tue, Feb 19, 2013 at 11:28 AM, Tim Smith tsmith@llnw.com wrote:

Health Inspector is an awesome tool for keeping your local repo and the
server in sync. It compares it all and looks at checksums so it's not just
versions.

http://bmarini.github.com/health_inspector/

[image: Limelight Networks] http://www.limelight.com/ Tim Smith - Systems
Engineer
m: +1 707.738.8132

On Feb 19, 2013, at 9:26 AM, John Alberts john.m.alberts@gmail.com
wrote:

I'm wondering what you guys use to compare the versions of your local
cookbooks to what is on the server and in a specific environment. Seems
like there should be a knife plugin for this, but I couldn't find one that
does this. The knife-env-diff plugin compares versions in two local env
files, but I didn't see anything comparing local cookbook versions to env
files or what's currently on the server. Should be pretty easy to whip up
a knife plugin for this, but I figured I'd ask before I bother writing one.

Thanks
John

--
John Alberts

On Tue, Feb 19, 2013 at 11:34 AM, Andrea Campi <andrea.campi@zephirworks.com

wrote:

I'm lazy, ahem, very busy so I'm still using a set of plugins that I wrote
some time ago: GitHub - andreacampi/knife-export-plugins: A set of export plugins for Chef's `knife`.

I'm not sure anymore that JSON is the right thing for me, but it may help
you :slight_smile:

Very cool plugins. I can think of some other uses for these, but I don't
see how these will help me compare server cookbook versions to my local
repo versions. The 3 plugins you have work with data bags, nodes, and
roles.

--
John Alberts

That page should actually be updated. Adam Sinnett updated it with support for JSON a while back (quandrum (Adam Sinnett) · GitHub). We always used it against JSON file.

Tim Smith - Systems Engineer
m: +1 707.738.8132

On Feb 19, 2013, at 9:31 AM, John Alberts john.m.alberts@gmail.com wrote:

Haven't seen that before. Looks interesting, though, I see a problem with using it along with knife-spork.

Assumptions

Your roles and environments are written using the ruby DSL.
knife-spork only works with json env files and it's engrained in my workflow, so that's a no go for me unfortunatley.

On Tue, Feb 19, 2013 at 11:28 AM, Tim Smith tsmith@llnw.com wrote:
Health Inspector is an awesome tool for keeping your local repo and the server in sync. It compares it all and looks at checksums so it's not just versions.

http://bmarini.github.com/health_inspector/

Tim Smith - Systems Engineer
m: +1 707.738.8132

On Feb 19, 2013, at 9:26 AM, John Alberts john.m.alberts@gmail.com wrote:

I'm wondering what you guys use to compare the versions of your local cookbooks to what is on the server and in a specific environment. Seems like there should be a knife plugin for this, but I couldn't find one that does this. The knife-env-diff plugin compares versions in two local env files, but I didn't see anything comparing local cookbook versions to env files or what's currently on the server. Should be pretty easy to whip up a knife plugin for this, but I figured I'd ask before I bother writing one.

Thanks
John

--
John Alberts

On Tue, Feb 19, 2013 at 6:39 PM, John Alberts john.m.alberts@gmail.comwrote:

On Tue, Feb 19, 2013 at 11:34 AM, Andrea Campi <
andrea.campi@zephirworks.com> wrote:

I'm lazy, ahem, very busy so I'm still using a set of plugins that I
wrote some time ago: GitHub - andreacampi/knife-export-plugins: A set of export plugins for Chef's `knife`.

I'm not sure anymore that JSON is the right thing for me, but it may help
you :slight_smile:

Very cool plugins. I can think of some other uses for these, but I don't
see how these will help me compare server cookbook versions to my local
repo versions. The 3 plugins you have work with data bags, nodes, and
roles.

Uh, ahem, right, I read too quickly and thought you wanted those too… Sorry
for the noise.

Maybe you could use health_inspector and strip it down to only deal with
cookbooks, and use these for roles etc?

On Tue, Feb 19, 2013 at 11:42 AM, Tim Smith tsmith@llnw.com wrote:

That page should actually be updated. Adam Sinnett updated it with
support for JSON a while back (quandrum (Adam Sinnett) · GitHub). We always
used it against JSON file.

Thanks. I'll give that a try.

--
John Alberts

Health_inspector is great. Works for what I needed and more.
Thank you.

On Tue, Feb 19, 2013 at 11:45 AM, John Alberts john.m.alberts@gmail.comwrote:

On Tue, Feb 19, 2013 at 11:42 AM, Tim Smith tsmith@llnw.com wrote:

That page should actually be updated. Adam Sinnett updated it with
support for JSON a while back (quandrum (Adam Sinnett) · GitHub). We always
used it against JSON file.

Thanks. I'll give that a try.

--
John Alberts

--
John Alberts

knife diff /cookbooks should work :slight_smile:

If your current directory is the cookbooks dir, you can just type “knife diff”.

–John

From: John Alberts <john.m.alberts@gmail.commailto:john.m.alberts@gmail.com>
Reply-To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Date: Tuesday, February 19, 2013 9:32 AM
To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Subject: [chef] Re: Re: Re: comparing local cookbooks to server

On Tue, Feb 19, 2013 at 11:29 AM, Ranjib Dey <dey.ranjib@gmail.commailto:dey.ranjib@gmail.com> wrote:
https://github.com/jkeiser/knife-essentials

this is already included in chef 11, you have to install it separately if you are on chef 10.x

I tried this yesterday, but I couldn’t figure out the syntax to compare my local cookbooks to what’s currently on the server. Any ideas how to do this?


John Alberts

I currently use knife-inspect (GitHub - bmarini/knife-inspect: Inspect your chef repo as is compares to what is on your chef server),
which appears to be an early version of health inspector (same author), but
i may switch to the knife diff that comes with knife essentials in chef 11
once i start running 11 on my workstation.

-jesse

On Tue, Feb 19, 2013 at 1:33 PM, John Keiser jkeiser@opscode.com wrote:

knife diff /cookbooks should work :slight_smile:

If your current directory is the cookbooks dir, you can just type "knife
diff".

--John

From: John Alberts john.m.alberts@gmail.com
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Tuesday, February 19, 2013 9:32 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Re: Re: Re: comparing local cookbooks to server

On Tue, Feb 19, 2013 at 11:29 AM, Ranjib Dey dey.ranjib@gmail.com wrote:

GitHub - jkeiser/knife-essentials: Knife commands to treat the Chef server like a filesystem

this is already included in chef 11, you have to install it separately
if you are on chef 10.x

I tried this yesterday, but I couldn't figure out the syntax to compare my
local cookbooks to what's currently on the server. Any ideas how to do
this?

--
John Alberts

On Tue, Feb 19, 2013 at 12:33 PM, John Keiser jkeiser@opscode.com wrote:

knife diff /cookbooks should work :slight_smile:

Yep, that works too. Though I much prefer the output of health_inspector
for just a simple comparison. Nice to the know the syntax for knife diff
to then see the actual changes. :slight_smile:
Thanks

--
John Alberts

FYI if you’re only looking to find out what is different (not the actual changes), you can also do

knife diff —name-status /cookbooks

(The command line parameters are modeled off of git diff.)

Another thing: once you discover which things are different and decide which changes you want to keep / which you want to discard, you can use knife upload and knife download to do it (same command line parameters). Upload cookbooks/roles/etc. to the server with knife upload, or copy the server contents down with knife download. Knife upload /cookbooks will upload all cookbooks, knife upload /cookbooks/apache2 will upload apache2 only, knife download works the same way. If your current directory is the cookbooks directory, knife upload . Or knife upload apache2 will work (it’s aware of the current directory).

–John

From: John Alberts <john.m.alberts@gmail.commailto:john.m.alberts@gmail.com>
Reply-To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Date: Tuesday, February 19, 2013 10:58 AM
To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Subject: [chef] Re: Re: Re: Re: Re: comparing local cookbooks to server

On Tue, Feb 19, 2013 at 12:33 PM, John Keiser <jkeiser@opscode.commailto:jkeiser@opscode.com> wrote:
knife diff /cookbooks should work :slight_smile:

Yep, that works too. Though I much prefer the output of health_inspector for just a simple comparison. Nice to the know the syntax for knife diff to then see the actual changes. :slight_smile:
Thanks


John Alberts