Debug School

Manasi Gokhale
Manasi Gokhale

Posted on • Updated on

Assignment 1- Chef

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 'Test@1234'
end

file 'assignment1.txt' do
content "This is a test file."
mode '0755'
owner 'ec2-user'
group 'root'
end`

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

file '/var/www/html/index.php' do
content 'This is a placeholder for the home page.'
mode '0755'
owner 'ec2-user'
group 'root'
end

Write a chef recipe to Create a directory

directory '/var/www/html/test' do
owner 'ec2-user'
group 'root'
mode '0755'
action :create
end

Write a chef recipe to execiute one sample bash script.
bash 'Execute my script' do
user 'root'
cwd '/var/www/html/test'
code <<-EOH
/home/centos/hello.sh
EOH
end

Write a chef recipe to install git.**
package 'git' do
action :install
end

git 'gitclone' do
remote 'origin'
repository 'https://github.com/scmgalaxy/helloworld-java-maven'
user 'root'
action :sync
end

Write a chef recipe to create group and user in linux.
log 'calling' do
Calling 'new call details added to the log.'
level :info
action :write
end

Top comments (0)