Book Image

Configuration Management with Chef-Solo

By : Naveed ur Rahman
Book Image

Configuration Management with Chef-Solo

By: Naveed ur Rahman

Overview of this book

Table of Contents (13 chapters)

Using files


Files are used as a resource to manage files on a new or existing node to create, delete, or update file contents. They contain user and group information along with the permission that needs to be assigned.

The syntax of the files is mentioned in the following code:

file "/tmp/testfile" do
  owner "root"  group "root"
  mode "0755"
  action :create
end

The preceding code block will be used to create a testfile in the /tmp folder, by the root user. The action attribute specifies the action that needs to be created.