Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save johnfitzpatrick/ff33120b853e0e718c0e to your computer and use it in GitHub Desktop.
Save johnfitzpatrick/ff33120b853e0e718c0e to your computer and use it in GitHub Desktop.
cookbooks/apache/providers/vhost.rb
use_inline_resources
action :create do
# Set the document root
document_root = "/srv/apache/#{new_resource.site_name}"
# Add a template for Apache virtual host configuration
template "/etc/httpd/conf.d/#{new_resource.site_name}.conf" do
source "custom.erb"
mode "0644"
variables(
:document_root => document_root,
:port => new_resource.site_port
)
end
directory document_root do
mode "0755"
recursive true
end
# Add a template resource for the virtual host's index.html
template "#{document_root}/index.html" do
source "index.html.erb"
mode "0644"
variables(
:site_name => new_resource.site_name,
:port => new_resource.site_port
)
end
end
@scarolan
Copy link

scarolan commented Oct 6, 2015

Line 17 is indented. And it's super annoying. My OCD is killing me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment