Last active
October 19, 2016 17:01
-
-
Save trivoallan/e787f632e65adde5d1f58beeaabb277c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Recipe: ws::default | |
* file[/etc/apache2/conf-available/vhost] action delete (up to date) | |
* template[/etc/apache2/conf-available/vhost.conf] action create | |
================================================================================ | |
Error executing action `create` on resource 'template[/etc/apache2/conf-available/vhost.conf]' | |
================================================================================ | |
Chef::Mixin::Template::TemplateError | |
------------------------------------ | |
undefined method `each' for nil:NilClass | |
Resource Declaration: | |
--------------------- | |
# In /tmp/kitchen/cache/cookbooks/apache2/definitions/apache_conf.rb | |
30: template "#{params[:conf_path]}/#{conf_name}" do | |
31: source params[:source] || "#{conf_name}.erb" | |
32: cookbook params[:cookbook] if params[:cookbook] | |
33: owner 'root' | |
34: group node['apache']['root_group'] | |
35: backup false | |
36: mode '0644' | |
37: notifies :restart, 'service[apache2]', :delayed | |
38: end | |
39: | |
Compiled Resource: | |
------------------ | |
# Declared in /tmp/kitchen/cache/cookbooks/apache2/definitions/apache_conf.rb:30:in `block in from_file' | |
template("/etc/apache2/conf-available/vhost.conf") do | |
params {:enable=>true, :name=>"vhost", :conf_path=>"/etc/apache2/conf-available"} | |
action [:create] | |
retries 0 | |
retry_delay 2 | |
default_guard_interpreter :default | |
source "vhost.conf.erb" | |
declared_type :template | |
cookbook_name "ws" | |
recipe_name "default" | |
owner "root" | |
group "root" | |
mode "0644" | |
path "/etc/apache2/conf-available/vhost.conf" | |
end | |
Template Context: | |
----------------- | |
on line #1 | |
1: <% @hostnames.each do |hostname| -%> | |
2: - <%= hostname %> | |
3: <% end %> | |
Platform: | |
--------- | |
x86_64-linux | |
Running handlers: | |
[2016-10-19T16:01:50+00:00] ERROR: Running exception handlers | |
Running handlers complete | |
[2016-10-19T16:01:50+00:00] ERROR: Exception handlers complete | |
Chef Client failed. 0 resources updated in 04 seconds | |
[2016-10-19T16:01:50+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out | |
[2016-10-19T16:01:50+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report | |
[2016-10-19T16:01:50+00:00] ERROR: | |
Chef::Mixin::Template::TemplateError (undefined method `each' for nil:NilClass) on line #1: | |
1: <% @hostnames.each do |hostname| -%> | |
2: - <%= hostname %> | |
3: <% end %> | |
(erubis):1:in `block in evaluate' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb:74:in `instance_eval' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb:74:in `evaluate' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/mixin/template.rb:161:in `_render_template' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/mixin/template.rb:147:in `render_template' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/provider/template/content.rb:53:in `file_for_provider' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/file_content_management/content_base.rb:40:in `tempfile' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/provider/file.rb:462:in `tempfile' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/provider/file.rb:339:in `do_generate_content' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/provider/file.rb:150:in `action_create' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/provider.rb:145:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/resource.rb:603:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/runner.rb:69:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/runner.rb:97:in `block (2 levels) in converge' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/runner.rb:97:in `each' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/runner.rb:97:in `block in converge' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/resource_collection/stepable_iterator.rb:85:in `step' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource' | |
/opt/chef/embedded/lib/ruby/2.3.0/forwardable.rb:189:in `execute_each_resource' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/runner.rb:96:in `converge' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/client.rb:669:in `block in converge' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/client.rb:664:in `catch' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/client.rb:664:in `converge' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/client.rb:703:in `converge_and_save' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/client.rb:283:in `run' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application.rb:302:in `block in fork_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application.rb:290:in `fork' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application.rb:290:in `fork_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application.rb:255:in `block in run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/local_mode.rb:44:in `with_server_connectivity' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application.rb:243:in `run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application/client.rb:451:in `block in interval_run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application/client.rb:450:in `loop' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application/client.rb:450:in `interval_run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application/client.rb:434:in `run_application' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application.rb:60:in `run' | |
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/bin/chef-client:26:in `<top (required)>' | |
/opt/chef/bin/chef-client:54:in `load' | |
/opt/chef/bin/chef-client:54:in `<main>' | |
[2016-10-19T16:01:50+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) | |
>>>>>> ------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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Apache configuration | |
template '/etc/apache2/sites-available/vhost.conf' do | |
source 'vhost.conf.erb' | |
variables :hostnames => ['a', 'b'] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% @hostname.each do |hostname| -%> | |
- <%= hostname %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment