Debug School

Akshay Kumar Gupta
Akshay Kumar Gupta

Posted on

Chef Assignment1

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

user 'ec2-user' do
comment 'ec2-user'
action :create
end

file '/home/centos/test/File1.txt
mode '754'
owner 'ec2-user'
group 'root'
action :create
end

2.Write a recipe to updates the access (atime) and file modification (mtime) times for a file.

file 'update1' do
content 'update time'
atomic_update true
action :touch
end

5.Write a chef recipe to Create a directory
directory '/home/centos/test1 do
owner 'ec2-user'
group 'root'
mode '754'
action :create
end

Top comments (0)