Possible to log or export cookbook versions or refs

Hello,
I am troubleshooting an issue that involved the versions of cookbooks pinned by
our roles vs the cookbook versions uploaded by berks upload. We have our own
cookbooks which set attributes etc and then call community cookbooks, then
those call other cookbooks. It would be tremendously helpful to see the
version (or gitref) of the compiled cookbook list: is there any way to do this?

For example
ec2-54-80-93-100.compute-1.amazonaws.com resolving cookbooks for run list:
[“cook_base”, “cook_common”, “cook_common::users_sigma_stream”,
“cook_logstash”]
ec2-54-80-93-100.compute-1.amazonaws.com Synchronizing Cookbooks:
ec2-54-80-93-100.compute-1.amazonaws.com - cook_base
ec2-54-80-93-100.compute-1.amazonaws.com - apt
ec2-54-80-93-100.compute-1.amazonaws.com - hostname
ec2-54-80-93-100.compute-1.amazonaws.com - hostsfile
ec2-54-80-93-100.compute-1.amazonaws.com - cook_common
ec2-54-80-93-100.compute-1.amazonaws.com - chef-solo-search
ec2-54-80-93-100.compute-1.amazonaws.com - users
ec2-54-80-93-100.compute-1.amazonaws.com - sudo
ec2-54-80-93-100.compute-1.amazonaws.com - ntp
ec2-54-80-93-100.compute-1.amazonaws.com - copperegg
ec2-54-80-93-100.compute-1.amazonaws.com - chef_handler
ec2-54-80-93-100.compute-1.amazonaws.com - cook_logstash
ec2-54-80-93-100.compute-1.amazonaws.com - logstash
ec2-54-80-93-100.compute-1.amazonaws.com - build-essential
ec2-54-80-93-100.compute-1.amazonaws.com - runit
ec2-54-80-93-100.compute-1.amazonaws.com - yum
ec2-54-80-93-100.compute-1.amazonaws.com - yum-epel
ec2-54-80-93-100.compute-1.amazonaws.com - git
ec2-54-80-93-100.compute-1.amazonaws.com - dmg
ec2-54-80-93-100.compute-1.amazonaws.com - windows
ec2-54-80-93-100.compute-1.amazonaws.com - ant
ec2-54-80-93-100.compute-1.amazonaws.com - java
ec2-54-80-93-100.compute-1.amazonaws.com - ark
ec2-54-80-93-100.compute-1.amazonaws.com - logrotate
ec2-54-80-93-100.compute-1.amazonaws.com - rabbitmq
ec2-54-80-93-100.compute-1.amazonaws.com - erlang
ec2-54-80-93-100.compute-1.amazonaws.com - yum-erlang_solutions
ec2-54-80-93-100.compute-1.amazonaws.com - python
ec2-54-80-93-100.compute-1.amazonaws.com - kibana
ec2-54-80-93-100.compute-1.amazonaws.com - nginx
ec2-54-80-93-100.compute-1.amazonaws.com - bluepill
ec2-54-80-93-100.compute-1.amazonaws.com - rsyslog
ec2-54-80-93-100.compute-1.amazonaws.com - ohai
ec2-54-80-93-100.compute-1.amazonaws.com - apache2
ec2-54-80-93-100.compute-1.amazonaws.com - cook_java
ec2-54-80-93-100.compute-1.amazonaws.com - cook_nginx
ec2-54-80-93-100.compute-1.amazonaws.com Compiling Cookbooks…

Is it possible to pass a bootstrap option that will append the version of each
cookbook?

In this particular case I was able to track down the pinned version that needed
to be bumped but it took awhile and I was hoping for the future that I could
log or display these versions at bootstrap.

Thank you,
Neal Brown
W2O Digital

Hi Neal,

This was addressed a few months ago on the list. The suggestion if I recall was to use this:

And also consider checking out:

The former we have in our base cookbook and it's super useful, although more for debugging than logging. The latter I have no direct experience with...

On Feb 26, 2014, at 5:05 PM, nbrown@w2odigital.com wrote:

Hello,
I am troubleshooting an issue that involved the versions of cookbooks pinned by
our roles vs the cookbook versions uploaded by berks upload. We have our own
cookbooks which set attributes etc and then call community cookbooks, then
those call other cookbooks. It would be tremendously helpful to see the
version (or gitref) of the compiled cookbook list: is there any way to do this?

For example
ec2-54-80-93-100.compute-1.amazonaws.com resolving cookbooks for run list:
["cook_base", "cook_common", "cook_common::users_sigma_stream",
"cook_logstash"]
ec2-54-80-93-100.compute-1.amazonaws.com Synchronizing Cookbooks:
ec2-54-80-93-100.compute-1.amazonaws.com - cook_base
ec2-54-80-93-100.compute-1.amazonaws.com - apt
ec2-54-80-93-100.compute-1.amazonaws.com - hostname
ec2-54-80-93-100.compute-1.amazonaws.com - hostsfile
ec2-54-80-93-100.compute-1.amazonaws.com - cook_common
ec2-54-80-93-100.compute-1.amazonaws.com - chef-solo-search
ec2-54-80-93-100.compute-1.amazonaws.com - users
ec2-54-80-93-100.compute-1.amazonaws.com - sudo
ec2-54-80-93-100.compute-1.amazonaws.com - ntp
ec2-54-80-93-100.compute-1.amazonaws.com - copperegg
ec2-54-80-93-100.compute-1.amazonaws.com - chef_handler
ec2-54-80-93-100.compute-1.amazonaws.com - cook_logstash
ec2-54-80-93-100.compute-1.amazonaws.com - logstash
ec2-54-80-93-100.compute-1.amazonaws.com - build-essential
ec2-54-80-93-100.compute-1.amazonaws.com - runit
ec2-54-80-93-100.compute-1.amazonaws.com - yum
ec2-54-80-93-100.compute-1.amazonaws.com - yum-epel
ec2-54-80-93-100.compute-1.amazonaws.com - git
ec2-54-80-93-100.compute-1.amazonaws.com - dmg
ec2-54-80-93-100.compute-1.amazonaws.com - windows
ec2-54-80-93-100.compute-1.amazonaws.com - ant
ec2-54-80-93-100.compute-1.amazonaws.com - java
ec2-54-80-93-100.compute-1.amazonaws.com - ark
ec2-54-80-93-100.compute-1.amazonaws.com - logrotate
ec2-54-80-93-100.compute-1.amazonaws.com - rabbitmq
ec2-54-80-93-100.compute-1.amazonaws.com - erlang
ec2-54-80-93-100.compute-1.amazonaws.com - yum-erlang_solutions
ec2-54-80-93-100.compute-1.amazonaws.com - python
ec2-54-80-93-100.compute-1.amazonaws.com - kibana
ec2-54-80-93-100.compute-1.amazonaws.com - nginx
ec2-54-80-93-100.compute-1.amazonaws.com - bluepill
ec2-54-80-93-100.compute-1.amazonaws.com - rsyslog
ec2-54-80-93-100.compute-1.amazonaws.com - ohai
ec2-54-80-93-100.compute-1.amazonaws.com - apache2
ec2-54-80-93-100.compute-1.amazonaws.com - cook_java
ec2-54-80-93-100.compute-1.amazonaws.com - cook_nginx
ec2-54-80-93-100.compute-1.amazonaws.com Compiling Cookbooks...

Is it possible to pass a bootstrap option that will append the version of each
cookbook?

In this particular case I was able to track down the pinned version that needed
to be bumped but it took awhile and I was hoping for the future that I could
log or display these versions at bootstrap.

Thank you,
Neal Brown
W2O Digital

I’m not aware of any bootstrap flags, but you can inspect the resolved cookbooks and log them yourself. After recently fixing some version conflict issues, I’m planning on writing a cookbook that compares the resolved version of every cookbook in the runlist with the most recent version allowed in the environment, and notifies if they’re not the same.

Greg


From: nbrown@w2odigital.com [nbrown@w2odigital.com]
Sent: Wednesday, February 26, 2014 4:05 PM
To: chef@lists.opscode.com
Subject: [chef] Possible to log or export cookbook versions or refs

Hello,
I am troubleshooting an issue that involved the versions of cookbooks pinned by
our roles vs the cookbook versions uploaded by berks upload. We have our own
cookbooks which set attributes etc and then call community cookbooks, then
those call other cookbooks. It would be tremendously helpful to see the
version (or gitref) of the compiled cookbook list: is there any way to do this?

For example
ec2-54-80-93-100.compute-1.amazonaws.com resolving cookbooks for run list:
[“cook_base”, “cook_common”, “cook_common::users_sigma_stream”,
“cook_logstash”]
ec2-54-80-93-100.compute-1.amazonaws.com Synchronizing Cookbooks:
ec2-54-80-93-100.compute-1.amazonaws.com - cook_base
ec2-54-80-93-100.compute-1.amazonaws.com - apt
ec2-54-80-93-100.compute-1.amazonaws.com - hostname
ec2-54-80-93-100.compute-1.amazonaws.com - hostsfile
ec2-54-80-93-100.compute-1.amazonaws.com - cook_common
ec2-54-80-93-100.compute-1.amazonaws.com - chef-solo-search
ec2-54-80-93-100.compute-1.amazonaws.com - users
ec2-54-80-93-100.compute-1.amazonaws.com - sudo
ec2-54-80-93-100.compute-1.amazonaws.com - ntp
ec2-54-80-93-100.compute-1.amazonaws.com - copperegg
ec2-54-80-93-100.compute-1.amazonaws.com - chef_handler
ec2-54-80-93-100.compute-1.amazonaws.com - cook_logstash
ec2-54-80-93-100.compute-1.amazonaws.com - logstash
ec2-54-80-93-100.compute-1.amazonaws.com - build-essential
ec2-54-80-93-100.compute-1.amazonaws.com - runit
ec2-54-80-93-100.compute-1.amazonaws.com - yum
ec2-54-80-93-100.compute-1.amazonaws.com - yum-epel
ec2-54-80-93-100.compute-1.amazonaws.com - git
ec2-54-80-93-100.compute-1.amazonaws.com - dmg
ec2-54-80-93-100.compute-1.amazonaws.com - windows
ec2-54-80-93-100.compute-1.amazonaws.com - ant
ec2-54-80-93-100.compute-1.amazonaws.com - java
ec2-54-80-93-100.compute-1.amazonaws.com - ark
ec2-54-80-93-100.compute-1.amazonaws.com - logrotate
ec2-54-80-93-100.compute-1.amazonaws.com - rabbitmq
ec2-54-80-93-100.compute-1.amazonaws.com - erlang
ec2-54-80-93-100.compute-1.amazonaws.com - yum-erlang_solutions
ec2-54-80-93-100.compute-1.amazonaws.com - python
ec2-54-80-93-100.compute-1.amazonaws.com - kibana
ec2-54-80-93-100.compute-1.amazonaws.com - nginx
ec2-54-80-93-100.compute-1.amazonaws.com - bluepill
ec2-54-80-93-100.compute-1.amazonaws.com - rsyslog
ec2-54-80-93-100.compute-1.amazonaws.com - ohai
ec2-54-80-93-100.compute-1.amazonaws.com - apache2
ec2-54-80-93-100.compute-1.amazonaws.com - cook_java
ec2-54-80-93-100.compute-1.amazonaws.com - cook_nginx
ec2-54-80-93-100.compute-1.amazonaws.com Compiling Cookbooks…

Is it possible to pass a bootstrap option that will append the version of each
cookbook?

In this particular case I was able to track down the pinned version that needed
to be bumped but it took awhile and I was hoping for the future that I could
log or display these versions at bootstrap.

Thank you,
Neal Brown
W2O Digital