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.