-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Infrastructure as Code Cookbook
By :

A very useful Chef feature is the ability to manage files right from the Chef code. Either plain files can be copied or dynamic files can be generated through templates. We'll leverage this feature to create an example PHP test file and dynamically generate Apache VirtualHosts for our LAMP server, so you'll know how to reuse it anywhere else.
To work through this recipe, you will need the following:
A working Chef DK installation on the workstation
A working Chef client configuration on the remote host
Optionally, the Chef code from the previous recipes
We'll manage two different kinds of files in two different ways: a static file and a dynamic file generated from a template, so the most common usage is covered.
Let's begin by creating a basic PHP file that will only display the phpinfo()
result. This is done using the simple file
resource with the file path as argument, giving its content inline...
Change the font size
Change margin width
Change background colour