Created
May 21, 2014 09:37
-
-
Save johnfitzpatrick/ff33120b853e0e718c0e to your computer and use it in GitHub Desktop.
cookbooks/apache/providers/vhost.rb
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 17 is indented. And it's super annoying. My OCD is killing me.