Test-kitchen cookbook dependencies


#1

ashdcsbamboo00:~/git/RS-DCS-Base$ kitchen test
.
.
.
Thank you for installing Chef!
Transferring files to
Starting Chef Client, version 12.2.1
Compiling Cookbooks…

   Running handlers:
   [2015-04-17T18:39:48+00:00] ERROR: Running exception handlers
   Running handlers complete
   [2015-04-17T18:39:48+00:00] ERROR: Exception handlers complete
   [2015-04-17T18:39:48+00:00] FATAL: Stacktrace dumped to

/tmp/kitchen/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 1.315520495 seconds
[2015-04-17T18:39:48+00:00] ERROR: Cookbook RS-DCS-Chef not found.
If you’re loading RS-DCS-Chef from another cookbook, make sure you
configure the dependency in your metadata
[2015-04-17T18:39:48+00:00] FATAL:
Chef::Exceptions::ChildConvergeError: Chef run process exited
unsuccessfully (exit code 1)

Converge failed on instance .
Please see .kitchen/logs/default-ubuntu-1404.log for more details
------Exception-------
Class: Kitchen::ActionFailed
Message: SSH exited (1) for command: [sh -c ‘
sudo -E /opt/chef/bin/chef-solo --config /tmp/kitchen/solo.rb --log_level
auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json
’]


ashdcsbamboo00:~/git/RS-DCS-Base$ more metadata.rb
.
.
.

%w(sudo apt sssd_ldap RS-DCS-Inventory RS-DCS-Chef RS-DCS-Postfix).each do
|cb|
depends cb
end

supports ‘ubuntu’, '>= 10.04’
supports ‘debian’, '>= 6.0’
supports ‘centos’, '>= 6.0’
supports ‘oracle’, '>= 5.0’
supports ‘amazon’, '>= 2014.03’
supports ‘redhat’, '>= 5.0’
ashdcsbamboo00:~/git/RS-DCS-Base$ cat .kitchen.yml
driver_plugin: docker
driver_config:
socket: tcp://localhost:5000
require_chef_omnibus: true
customize:
memory: 1024

platforms:

  • name: ubuntu-14.04
  • name: ubuntu-12.04
  • name: ubuntu-10.04
  • name: centos-6.5
  • name: centos-5.10
  • name: centos-7.0

suites:

  • name: default
    run_list:
    • recipe[RS-DCS-Base]

Any ideas about what I need to do to make chef-solo copy over cookbook
dependencies when using test-kitchen?


~~ StormeRider ~~

“Every world needs its heroes […] They inspire us to be better than we
are. And they protect from the darkness that’s just around the corner.”

(from Smallville Season 6x1: “Zod”)

On why I hate the phrase “that’s so lame”… http://bit.ly/Ps3uSS


#2

Using Berkshelf/Berksfile should be able to solve the issue you are seeing.
Example (stolen):
cookbook ‘application’, git: 'git@github.com:company-cookbook/application.git’
cookbook ‘nginx’, git: 'git@github.com:company-cookbook/nginx.git’
cookbook ‘unicorn’, git: ‘git@github.com:company-cookbook/unicorn.git’

Basically, it needs a way to know where to find the cookbooks, if that’s a supermarket, berks api, git, local path, etc.


James

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Friday, April 17, 2015 1:44 PM
To: chef@lists.opscode.com
Subject: [chef] Test-kitchen cookbook dependencies

ashdcsbamboo00:~/git/RS-DCS-Base$ kitchen test
.
.
.
Thank you for installing Chef!
Transferring files to
Starting Chef Client, version 12.2.1
Compiling Cookbooks…

   Running handlers:
   [2015-04-17T18:39:48+00:00] ERROR: Running exception handlers
   Running handlers complete
   [2015-04-17T18:39:48+00:00] ERROR: Exception handlers complete
   [2015-04-17T18:39:48+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   Chef Client failed. 0 resources updated in 1.315520495 seconds
   [2015-04-17T18:39:48+00:00] ERROR: Cookbook RS-DCS-Chef not found. If you're loading RS-DCS-Chef from another cookbook, make sure you configure the dependency in your metadata
   [2015-04-17T18:39:48+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Converge failed on instance .
Please see .kitchen/logs/default-ubuntu-1404.log for more details
------Exception-------
Class: Kitchen::ActionFailed
Message: SSH exited (1) for command: [sh -c ‘
sudo -E /opt/chef/bin/chef-solo --config /tmp/kitchen/solo.rb --log_level auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json
’]


ashdcsbamboo00:~/git/RS-DCS-Base$ more metadata.rb
.
.
.

%w(sudo apt sssd_ldap RS-DCS-Inventory RS-DCS-Chef RS-DCS-Postfix).each do |cb|
depends cb
end

supports ‘ubuntu’, '>= 10.04’
supports ‘debian’, '>= 6.0’
supports ‘centos’, '>= 6.0’
supports ‘oracle’, '>= 5.0’
supports ‘amazon’, '>= 2014.03’
supports ‘redhat’, '>= 5.0’
ashdcsbamboo00:~/git/RS-DCS-Base$ cat .kitchen.yml
driver_plugin: docker
driver_config:
socket: tcp://localhost:5000
require_chef_omnibus: true
customize:
memory: 1024

platforms:

  • name: ubuntu-14.04
  • name: ubuntu-12.04
  • name: ubuntu-10.04
  • name: centos-6.5
  • name: centos-5.10
  • name: centos-7.0

suites:

  • name: default
    run_list:
    • recipe[RS-DCS-Base]

Any ideas about what I need to do to make chef-solo copy over cookbook dependencies when using test-kitchen?


~~ StormeRider ~~
“Every world needs its heroes […] They inspire us to be better than we are. And they protect from the darkness that’s just around the corner.”

(from Smallville Season 6x1: “Zod”)

On why I hate the phrase “that’s so lame”… http://bit.ly/Ps3uSS

******* CONFIDENTIALITY NOTICE *******

This e-mail message and all attachments transmitted with it may contain legally privileged and confidential information intended solely for the use of the addressee. If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete this message from your system. Thank you.


#3

Aha, thanks. I forgot that I needed to render my Berksfile.erb into a real
Berksfile(.lock) first.


~~ StormeRider ~~

“Every world needs its heroes […] They inspire us to be better than we
are. And they protect from the darkness that’s just around the corner.”

(from Smallville Season 6x1: “Zod”)

On why I hate the phrase “that’s so lame”… http://bit.ly/Ps3uSS

On Fri, Apr 17, 2015 at 12:13 PM, James Erickson James.Erickson@wnco.com
wrote:

Using Berkshelf/Berksfile should be able to solve the issue you are
seeing.

Example (stolen):

cookbook ‘application’, git: ‘git@github.com:
company-cookbook/application.git’

cookbook ‘nginx’, git: ‘git@github.com:company-cookbook/nginx.git’

cookbook ‘unicorn’, git: ‘git@github.com:company-cookbook/unicorn.git’

Basically, it needs a way to know where to find the cookbooks, if that’s a
supermarket, berks api, git, local path, etc.

James

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Friday, April 17, 2015 1:44 PM
To: chef@lists.opscode.com
Subject: [chef] Test-kitchen cookbook dependencies

ashdcsbamboo00:~/git/RS-DCS-Base$ kitchen test

.

.

.

Thank you for installing Chef!

   Transferring files to <default-ubuntu-1404>

   Starting Chef Client, version 12.2.1

   Compiling Cookbooks...



   Running handlers:

   [2015-04-17T18:39:48+00:00] ERROR: Running exception handlers

   Running handlers complete

   [2015-04-17T18:39:48+00:00] ERROR: Exception handlers complete

   [2015-04-17T18:39:48+00:00] FATAL: Stacktrace dumped to

/tmp/kitchen/cache/chef-stacktrace.out

   Chef Client failed. 0 resources updated in 1.315520495 seconds

   [2015-04-17T18:39:48+00:00] ERROR: Cookbook RS-DCS-Chef not found.

If you’re loading RS-DCS-Chef from another cookbook, make sure you
configure the dependency in your metadata

   [2015-04-17T18:39:48+00:00] FATAL:

Chef::Exceptions::ChildConvergeError: Chef run process exited
unsuccessfully (exit code 1)

Converge failed on instance .

Please see .kitchen/logs/default-ubuntu-1404.log for more details

------Exception-------

Class: Kitchen::ActionFailed

Message: SSH exited (1) for command: [sh -c ’

sudo -E /opt/chef/bin/chef-solo --config /tmp/kitchen/solo.rb --log_level
auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json

']


ashdcsbamboo00:~/git/RS-DCS-Base$ more metadata.rb

.

.

.

%w(sudo apt sssd_ldap RS-DCS-Inventory RS-DCS-Chef RS-DCS-Postfix).each do
|cb|

depends cb

end

supports ‘ubuntu’, ‘>= 10.04’

supports ‘debian’, ‘>= 6.0’

supports ‘centos’, ‘>= 6.0’

supports ‘oracle’, ‘>= 5.0’

supports ‘amazon’, ‘>= 2014.03’

supports ‘redhat’, ‘>= 5.0’

ashdcsbamboo00:~/git/RS-DCS-Base$ cat .kitchen.yml

driver_plugin: docker

driver_config:

socket: tcp://localhost:5000

require_chef_omnibus: true

customize:

memory: 1024

platforms:

  • name: ubuntu-14.04

  • name: ubuntu-12.04

  • name: ubuntu-10.04

  • name: centos-6.5

  • name: centos-5.10

  • name: centos-7.0

suites:

  • name: default

    run_list:

    • recipe[RS-DCS-Base]

Any ideas about what I need to do to make chef-solo copy over cookbook
dependencies when using test-kitchen?

~~ StormeRider ~~

“Every world needs its heroes […] They inspire us to be better than we
are. And they protect from the darkness that’s just around the corner.”

(from Smallville Season 6x1: “Zod”)

On why I hate the phrase “that’s so lame”… http://bit.ly/Ps3uSS



******** CONFIDENTIALITY NOTICE ********

  • This e-mail message and all attachments transmitted with it may contain
    legally privileged and confidential information intended solely for the use
    of the addressee. If the reader of this message is not the intended
    recipient, you are hereby notified that any reading, dissemination,
    distribution, copying, or other use of this message or its attachments is
    strictly prohibited. If you have received this message in error, please
    notify the sender immediately and delete this message from your system.
    Thank you. *