Skip to content

Commit

Permalink
Change attributes from symbols to strings
Browse files Browse the repository at this point in the history
  • Loading branch information
David King committed Aug 6, 2012
1 parent 846b23c commit 0085c9e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -6,15 +6,15 @@ for a drupal environment.

### Requirements ###

* [Opscode's apache2 cookbook](http://community.opscode.com/cookbooks/apache2/)
* See [metadata.rb](https://github.com/xforty/chef-drupal/blob/master/metadata.rb)

### Attributes ###

#### default ####

* node[:drupal][:project_name] - fqdn of the site (you should override this)
* node[:drupal][:docroot] - apache docroot for the site (not necessary to override)
* node[:drupal][:server_name] - URL used to access the site locally (not necessary to override)
* `node['drupal']['project_name']` - Name of the web app (default: VM's host name)
* `node['drupal']['docroot']` - Apache docroot for the site
* `node['drupal']['server_name']` - URL used to access the site locally (default: project_name with ".local" appended)

### USAGE ###

Expand Down
6 changes: 3 additions & 3 deletions attributes/default.rb
Expand Up @@ -18,7 +18,7 @@
# limitations under the License.
#

default[:drupal][:project_name] = node['vagrant']['config']['keys']['vm']['host_name']
default[:drupal][:server_name] = "#{node[:drupal][:project_name]}.local"
default[:drupal][:docroot] = "/srv/www"
default['drupal']['project_name'] = node['vagrant']['config']['keys']['vm']['host_name']
default['drupal']['server_name'] = "#{node['drupal']['project_name']}.local"
default['drupal']['docroot'] = "/srv/www"

2 changes: 1 addition & 1 deletion metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs a drupal environment"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.1"
version "1.0.0"

depends "apache2"
depends "drush"
Expand Down
10 changes: 5 additions & 5 deletions recipes/default.rb
Expand Up @@ -31,16 +31,16 @@
if node['vagrant']['config']['keys']['vm']['networks'].empty?

# Using forwarded_ports always means "localhost" for server name
node[:drupal][:server_name] = "localhost"
node['drupal']['server_name'] = "localhost"

# Solves the problem of HTTP request statuses failing with forwarded_ports
# https://github.com/xforty/vagrant-drupal/issues/1
include_recipe "drupal::iptables"
end

# Define virtualhost in apache for site
web_app node[:drupal][:project_name] do
server_name node[:drupal][:server_name]
server_aliases [node[:drupal][:server_name], 'local.vbox']
docroot node[:drupal][:docroot]
web_app node['drupal']['project_name'] do
server_name node['drupal']['server_name']
server_aliases [node['drupal']['server_name']]
docroot node['drupal']['docroot']
end
6 changes: 3 additions & 3 deletions templates/default/web_app.conf.erb
Expand Up @@ -25,11 +25,11 @@
</Location>

LogLevel info
ErrorLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-error.log
CustomLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-access.log combined
ErrorLog <%= node['apache']['log_dir'] %>/<%= @params[:name] %>-error.log
CustomLog <%= node['apache']['log_dir'] %>/<%= @params[:name] %>-access.log combined

RewriteEngine On
RewriteLog <%= node[:apache][:log_dir] %>/<%= @application_name %>-rewrite.log
RewriteLog <%= node['apache']['log_dir'] %>/<%= @application_name %>-rewrite.log
RewriteLogLevel 0

# Canonical host, <%= @params[:server_name] %>
Expand Down

0 comments on commit 0085c9e

Please sign in to comment.