The issue seems to be with your erb template syntax, not a Apache configuration parsing issue with your vhosts configuration.
Folks,
Doing something a wee bit unorthodox, but it should work(in my world) and it doesn't. Probably my poor understanding, so appreciate if someone could point out the error of my ways...
I have already installed chef-server via apt-get from the opscode-chef repos, for ubuntu on 10.10. All seems well and it works. Have been deploying in a test environment for a few months...
Next I wanted to install apache on the chef-server, and setup some kind of proxy so I could connect to the chef server via ssl on port 443. There is some good documentation on how to do this manually on the opscode wiki, but I searched around and found essentially what looks like the same thing that has been automated as part of the chef-server recipe. So, I made up a role, and added the run list "chef-server::apache-proxy". Then I run this on the chef-server node, by simply assigning the role to the node. However, I get a stack trace, (repeated below).
From my initial investigations, it looks like I have a very poor understanding of just how vhosts are used in the apache2 recipe, and hence am struggling to know exaclty where to start looking for the problem. It seems to me to be a problem where I am not specifying the "hostname" of the chef-server, but I think if I had an example tutuorial on how to take the apache2 recipe, deploy it, then deploy one then two vhosts, then I think my understanding would be so much better. If anyone can help me, I would be happy to provide a tutuorial on how to do this, once I have done it(chicken/egg).
Anyway, thanks for any help you can offer.
Sc0tt..
NB Uploading apache2 [1.0.4]
Uploading chef-server [0.99.11]
************************Stack trace below ****************
[Wed, 04 Jan 2012 13:05:44 +0200] INFO: Processing directory[/etc/chef/certificates] action create (chef-server::apache-proxy line 41)
[Wed, 04 Jan 2012 13:05:44 +0200] INFO: Processing bash[Create SSL Certificates] action run (chef-server::apache-proxy line 47)
[Wed, 04 Jan 2012 13:05:44 +0200] INFO: Processing template[/etc/apache2/sites-available/chef-server-proxy.conf] action create (chef-server::apache-proxy line 29)
[Wed, 04 Jan 2012 13:05:44 +0200] ERROR: template[/etc/apache2/sites-available/chef-server-proxy.conf] (chef-server::apache-proxy line 29) has had an error
[Wed, 04 Jan 2012 13:05:44 +0200] ERROR: template[/etc/apache2/sites-available/chef-server-proxy.conf] (/var/cache/chef/cookbooks/apache2/definitions/web_app.rb:29:in `from_file') had an error:
Chef::Mixin::Template::TemplateError (undefined method `each' for nil:NilClass) on line #4:
2: <VirtualHost *:443>
3: ServerName <%= @params['server_name'] %>
4: ServerAlias <% @params['server_aliases'].each do |a| %><%= "#{a}" %> <% end %>
5:
6: DocumentRoot <%= node['chef_server']['doc_root'] %>
(erubis):4:in `evaluate'
/usr/lib/ruby/1.8/erubis/evaluator.rb:75:in `instance_eval'
/usr/lib/ruby/1.8/erubis/evaluator.rb:75:in `evaluate'
/usr/lib/ruby/vendor_ruby/chef/mixin/template.rb:41:in `render_template'
/usr/lib/ruby/vendor_ruby/chef/provider/template.rb:99:in `render_with_context'
/usr/lib/ruby/vendor_ruby/chef/provider/template.rb:39:in `action_create'
/usr/lib/ruby/vendor_ruby/chef/resource.rb:437:in `send'
/usr/lib/ruby/vendor_ruby/chef/resource.rb:437:in `run_action'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:45:in `run_action'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:81:in `converge'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:81:in `each'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:81:in `converge'
/usr/lib/ruby/vendor_ruby/chef/resource_collection.rb:94:in `execute_each_resource'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/usr/lib/ruby/vendor_ruby/chef/resource_collection.rb:92:in `execute_each_resource'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:76:in `converge'
/usr/lib/ruby/vendor_ruby/chef/client.rb:312:in `converge'
/usr/lib/ruby/vendor_ruby/chef/client.rb:160:in `run'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:239:in `run_application'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:229:in `loop'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:229:in `run_application'
/usr/lib/ruby/vendor_ruby/chef/application.rb:67:in `run'
/usr/bin/chef-client:25
/usr/lib/ruby/vendor_ruby/chef/mixin/template.rb:43:in `render_template'
/usr/lib/ruby/vendor_ruby/chef/provider/template.rb:99:in `render_with_context'
/usr/lib/ruby/vendor_ruby/chef/provider/template.rb:39:in `action_create'
/usr/lib/ruby/vendor_ruby/chef/resource.rb:437:in `send'
/usr/lib/ruby/vendor_ruby/chef/resource.rb:437:in `run_action'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:45:in `run_action'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:81:in `converge'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:81:in `each'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:81:in `converge'
/usr/lib/ruby/vendor_ruby/chef/resource_collection.rb:94:in `execute_each_resource'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/usr/lib/ruby/vendor_ruby/chef/resource_collection.rb:92:in `execute_each_resource'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:76:in `converge'
/usr/lib/ruby/vendor_ruby/chef/client.rb:312:in `converge'
/usr/lib/ruby/vendor_ruby/chef/client.rb:160:in `run'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:239:in `run_application'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:229:in `loop'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:229:in `run_application'
/usr/lib/ruby/vendor_ruby/chef/application.rb:67:in `run'
/usr/bin/chef-client:25
[Wed, 04 Jan 2012 13:05:44 +0200] ERROR: Running exception handlers
[Wed, 04 Jan 2012 13:05:45 +0200] FATAL: Saving node information to /var/cache/chef/failed-run-data.json
[Wed, 04 Jan 2012 13:05:45 +0200] ERROR: Exception handlers complete
[Wed, 04 Jan 2012 13:05:45 +0200] ERROR: Chef::Mixin::Template::TemplateError:
Chef::Mixin::Template::TemplateError (undefined method `each' for nil:NilClass) on line #4:
2: <VirtualHost *:443>
3: ServerName <%= @params['server_name'] %>
4: ServerAlias <% @params['server_aliases'].each do |a| %><%= "#{a}" %> <% end %>
5:
6: DocumentRoot <%= node['chef_server']['doc_root'] %>
(erubis):4:in `evaluate'
/usr/lib/ruby/1.8/erubis/evaluator.rb:75:in `instance_eval'
/usr/lib/ruby/1.8/erubis/evaluator.rb:75:in `evaluate'
/usr/lib/ruby/vendor_ruby/chef/mixin/template.rb:41:in `render_template'
/usr/lib/ruby/vendor_ruby/chef/provider/template.rb:99:in `render_with_context'
/usr/lib/ruby/vendor_ruby/chef/provider/template.rb:39:in `action_create'
/usr/lib/ruby/vendor_ruby/chef/resource.rb:437:in `send'
/usr/lib/ruby/vendor_ruby/chef/resource.rb:437:in `run_action'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:45:in `run_action'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:81:in `converge'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:81:in `each'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:81:in `converge'
/usr/lib/ruby/vendor_ruby/chef/resource_collection.rb:94:in `execute_each_resource'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/usr/lib/ruby/vendor_ruby/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/usr/lib/ruby/vendor_ruby/chef/resource_collection.rb:92:in `execute_each_resource'
/usr/lib/ruby/vendor_ruby/chef/runner.rb:76:in `converge'
/usr/lib/ruby/vendor_ruby/chef/client.rb:312:in `converge'
/usr/lib/ruby/vendor_ruby/chef/client.rb:160:in `run'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:239:in `run_application'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:229:in `loop'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:229:in `run_application'
/usr/lib/ruby/vendor_ruby/chef/application.rb:67:in `run'
/usr/bin/chef-client:25
Archive powered by MHonArc 2.6.16.