I'm trying to follow the Chef tutorial (ref. https://learn.chef.io/modules/create-a-web-app-cookbook/ubuntu/virtualbox/configure-mysql#/), to build a LAMP cookbook.
I've, as tutorial suggest, my chef dk on windows and my final node is Ubuntu 14.04 hosted on Oracle Virtualbox via vagrant.
Details about Chef I'm using here ...
Chef Development Kit Version: 3.1.0
chef-client version: 14.2.0
delivery version: master (6862f27aba89109a9630f0b6c6798efec56b4efe)
berks version: 7.0.4
kitchen version: 1.22.0
inspec version: 2.1.72
My kitchen.yml
is the follow ....
---
driver:
name: vagrant
network:
- ["private_network", {ip: "192.168.34.34"}]
provisioner:
name: chef_zero
always_update_cookbooks: true
verifier:
name: inspec
platforms:
- name: ubuntu-14.04
suites:
- name: default
data_bags_path: test/fixtures/default/data_bags
run_list:
- recipe[lamp::default]
verifier:
inspec_tests:
- test/integration/default
attributes:
My metadata.rb
is the follow ...
name 'lamp'
maintainer 'The Authors'
maintainer_email 'you@example.com'
license 'All Rights Reserved'
description 'Installs/Configures lamp'
long_description 'Installs/Configures lamp'
version '0.1.0'
chef_version '>= 12.14' if respond_to?(:chef_version)
issues_url 'https://github.com/learn-chef/lamp/issues' if respond_to?(:issues_url)
source_url 'https://github.com/learn-chef/lamp' if respond_to?(:source_url)
supports 'ubuntu'
depends 'httpd', '~> 0.6'
depends 'mysql', '~> 8.5'
depends 'mysql2_chef_gem', '~> 2.1'
depends 'database', '~> 6.1'
In my ~/.berkshelf/cookbooks
I can see this content
apt-7.0.0
build-essential-8.1.1
database-6.1.1
httpd-0.6.2
inifile_chef_gem-0.1.0
mariadb-1.5.4
mingw-2.1.0
mysql-8.5.1
mysql2_chef_gem-2.1.0
openssl-8.5.2
postgresql-7.1.0
selinux_policy-2.1.0
seven_zip-3.0.0
windows-5.0.0
yum-5.1.0
yum-epel-3.2.0
yum-scl-0.2.0
My cookbook and recipes are defined following the tutorial instructions ....
When I try to execute kitchen converge
(after kitchen create
... ), I obtain this ....
-----> Starting Kitchen (v1.22.0)
-----> Converging <default-ubuntu-1404>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 7.0.4...
Removing non-cookbook files before transfer
Preparing data_bags
Preparing validation.pem
Preparing client.rb
-----> Installing Chef Omnibus (install only if missing)
Downloading https://omnitruck.chef.io/install.sh to file /tmp/install.sh
Trying wget...
Download complete.
ubuntu 14.04 x86_64
Getting information for chef stable for ubuntu...
downloading https://omnitruck.chef.io/stable/chef/metadata?v=&p=ubuntu&pv=14.04&m=x86_64
to file /tmp/install.sh.1666/metadata.txt
trying wget...
sha1 64645bebefc45191064073a689a90c10a60fa9ae
sha256 9ae754e889fbcaaef5632c783a09f134c548c7fdc126de3846f2752acc0e3d3c
url https://packages.chef.io/files/stable/chef/14.3.37/ubuntu/14.04/chef_14.3.37-1_amd64.deb
version 14.3.37
downloaded metadata file looks valid...
/tmp/omnibus/cache/chef_14.3.37-1_amd64.deb exists
Comparing checksum with sha256sum...
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
You are installing an omnibus package without a version pin. If you are installing
on production servers via an automated process this is DANGEROUS and you will
be upgraded without warning on new releases, even to new major releases.
Letting the version float is only appropriate in desktop, test, development or
CI/CD environments.
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
Installing chef
installing with dpkg...
Selecting previously unselected package chef.
(Reading database ... 35419 files and directories currently installed.)
Preparing to unpack .../cache/chef_14.3.37-1_amd64.deb ...
Unpacking chef (14.3.37-1) ...
Setting up chef (14.3.37-1) ...
Thank you for installing Chef!
Transferring files to <default-ubuntu-1404>
Starting Chef Client, version 14.3.37
Creating a new client identity for default-ubuntu-1404 using the validator key.
resolving cookbooks for run list: ["lamp::default"]
Synchronizing Cookbooks:
- lamp (0.1.0)
- httpd (0.6.2)
- mysql (8.5.1)
- mysql2_chef_gem (2.1.0)
- database (6.1.1)
- build-essential (8.1.1)
- postgresql (7.1.0)
- seven_zip (3.0.0)
- mariadb (1.5.4)
- mingw (2.1.0)
- selinux_policy (2.1.0)
- apt (7.0.0)
- yum (5.1.0)
- yum-epel (3.2.0)
- yum-scl (0.2.0)
- openssl (8.5.2)
- windows (5.0.0)
- inifile_chef_gem (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
================================================================================
Recipe Compile Error in /tmp/kitchen/cache/cookbooks/seven_zip/providers/archive.rb
================================================================================
NameError
---------
uninitialized constant #<Class:0x00000000041e0bc8>::Windows
Cookbook Trace:
---------------
/tmp/kitchen/cache/cookbooks/seven_zip/providers/archive.rb:25:in `class_from_file'
Relevant File Content:
----------------------
/tmp/kitchen/cache/cookbooks/seven_zip/providers/archive.rb:
18: # limitations under the License.
19: #
20:
21: require 'fileutils'
22: require 'chef/mixin/shell_out'
23:
24: include Chef::Mixin::ShellOut
25>> include Windows::Helper
26:
27: def whyrun_supported?
28: true
29: end
30:
31: action :extract do
32: converge_by("Extract #{@new_resource.source} => #{@new_resource.path} (overwrite=#{@new_resource.overwrite})") do
33: FileUtils.mkdir_p(@new_resource.path) unless Dir.exist?(@new_resource.path)
34: local_source = cached_file(@new_resource.source, @new_resource.checksum)
System Info:
------------
chef_version=14.3.37
platform=ubuntu
platform_version=14.04
ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
program_name=/opt/chef/bin/chef-client
executable=/opt/chef/bin/chef-client
Running handlers:
[2018-08-21T13:10:45+00:00] ERROR: Running exception handlers
[2018-08-21T13:10:45+00:00] ERROR: Running exception handlers
Running handlers complete
[2018-08-21T13:10:45+00:00] ERROR: Exception handlers complete
[2018-08-21T13:10:45+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 07 seconds
[2018-08-21T13:10:45+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2018-08-21T13:10:45+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2018-08-21T13:10:45+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-08-21T13:10:45+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-08-21T13:10:45+00:00] FATAL: NameError: uninitialized constant #<Class:0x00000000041e0bc8>::Windows
[2018-08-21T13:10:45+00:00] FATAL: NameError: uninitialized constant #<Class:0x00000000041e0bc8>::Windows
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Converge failed on instance <default-ubuntu-1404>. Please see .kitchen/logs/default-ubuntu-1404.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
So something about seven_zip
... but my target node is on Ubuntu! Something is wrong but i don't understand where (I'm a newbie about Chef ....)
Thank you in advance!