My First CHEF Cookbook !

[The cookbook works only for debian based OS] Login To Chef Workstation: ssh -i key.pem ubuntu@chef-workstation Chef Workstation, @chef-repo directory Creating My Apache Cookbook #knife cookbook create myapache #vim cookbooks/myapache/recipes/default.rb package “apache2” do action :install end #To delete default VirtualHost cookbook_file “/etc/apache2/sites-enabled/000-default” do action :delete end template “/etc/apache2/sites-enabled/default” do source “default.erb” mode “0644” end #To […]

Chef MyDoc [ugly version]

Chef – Webinar Organizations : are like departments like Sales, Business Unit, Product etc Every Organization starts with a single environment Environment :  Staging, Development, Production = modeling life stages of the product. -Environment include data attributes necessary for configuring your infra eg: If its a ecommerce app and its using paypal then the development […]

Chef DSL Basics

A recipe is nothing but a list of resources ! Resource Syntax: type “name” do attribute “value” action :type_of_action end Resource Example I (Directory Resource): directory “/tmp/folder” do owner “root” group “root” mode 0755 action :create end Resource Example II (Package Resource): package “tar” do version “1.16.1-1” action :install end Some attributes are available to […]

Create New Cookbook and New Role

    Logging Into the Chef-Workstation: #ssh -i /sshkey root@ Always work inside the chef repo directory. #cd /root/chef-repo Command to create new cookbook #knife cookbook create mynewcookbook Putup the ruby codes into the recipe of the new cookbook #vim /root/chef-repo/cookbooks/mynewcookbook/recipes/default.rb Upload the cookbook to the Platform #knife cookbook upload mynewcookbook Now start the instance […]