Debug School

Rajeshwari Pawar
Rajeshwari Pawar

Posted on

Day2 Chef lab - part1 - partially complete

Q1 –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
password 'Hello$123'
end

group 'root' do
comment 'This is assignment root group'
end

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

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

Q4 – Write a chef recipe to execute one sample bash script.

bash 'Hello Bash' do
user 'root'
cwd '/home/centos'
code <<-EOH
./hello.sh
EOH
End

Q5 – Write a chef recipe to Create a directory

directory '/root/first_dir' do
owner 'root'
group 'root'
mode '0755'
action :create
end

Top comments (0)