Debug School

Adity Pratap Singh
Adity Pratap Singh

Posted on

Aditya's Assignment for Day-2

1- Write a recipe to create a file which should be owned by group called “root”, user “ec2-user” and permission executable.

Solution :
file "created-file.txt" do
owner 'ec2-user'
group 'root'
mode '754'
action :create
end
2- Write a recipe to updates the access (atime) and file modification (mtime) times for a file.

Sol:
file '/home/centos/chef-repo/cookbooks/example/recipes/atime.txt' do
content 'This is my first file'
action :touch
action :create
end

Top comments (0)