Information Technology Reference
In-Depth Information
#
#
#
package
"httpd"
service
"httpd"
ddo
action
[
:enable
,
:start
]
end
end
template
"/var/www/html/index.html"
ddo
source
'index.html.erb'
mode
'0644'
end
end
By default, the
httpd
server looks for web pages in the directory
/var/www/html
. The file for
the default website is expected to be in the file
/var/www/html/index.html
. We also still have
to set the file mode to be world-readable. What's probably new to you, compared to the
file
resource, is this
source
attribute.
The
source
attribute specifies the file containing a template with ERB statements. This tem-
plate is expected to be located underneath the
templates
folder in the cookbook, following
the same subdirectory convention as
files
. So to copy the template to all nodes (which is the
default), make sure that template files are located in the
templates/default
directory.