Skip to main content

Posts

Showing posts with the label recipe

Chef: Overview

Chef is a powerful automation platform that transforms infrastructure into code. Whether you’re operating in the cloud, on-premises, or in a hybrid environment, Chef automates how infrastructure is configured, deployed, and managed across your network, no matter its size. This diagram shows how you develop, test, and deploy your Chef code. The workstation is the location from which users interact with Chef. On the workstation users author and test  cookbooks  using tools such as  Test Kitchen  and interact with the Chef server using the  knife  and  chef command line tools. Nodes are the machines—physical, virtual, cloud, and so on—that are under management by Chef. The chef-client is installed on each node and is what  performs the automation on that machine . Use the Chef server as your foundation to create and manage flexible, dynamic infrastructure whether you manage 50 or 500,000 nodes, across multiple datacenters, public and private clouds, and in heterogeneous environments...

Chef: ChefDK

Create a linux machine, login into it and execute the following command: curl -s https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chefdk Now we need to change the default ruby to point it to the chef ruby and not the system ruby. Execute the following command for it. echo 'eval "$(chef shell-init bash)"' >> ~/.bash_profile Note: eval  is part of POSIX. Its an interface which can be a shell built-in.Its described in the "POSIX Programmer's Manual":  http://www.unix.com/man-page/posix/1posix/eval/ eval - construct command by concatenating arguments It will take an argument and construct a command of it, which will be executed by the shell. This is the example of the manpage: 1 ) foo = 10 x = foo 2 ) y = '$' $x 3 ) echo $y 4 ) $foo 5 ) eval y = '$' $x 6 ) echo $y 7 ) 10 In the first line you define  $foo  with the value  '10'  and  $x  with the value  'foo' . Now define  $y , which consists ...

Chef: Nodes and Search

Now login to your chef-node/chef-client and type ohai.  Ohai is automatically bootstraped when we install chef. You will get an output similar to below: ...... "OPEN_MAX": 1024, "PAGESIZE": 4096, "PAGE_SIZE": 4096, "PASS_MAX": 8192, "PTHREAD_DESTRUCTOR_ITERATIONS": 4, "PTHREAD_KEYS_MAX": 1024, "PTHREAD_STACK_MIN": 16384, "PTHREAD_THREADS_MAX": null, "SCHAR_MAX": 127, "SCHAR_MIN": -128, "SHRT_MAX": 32767, "SHRT_MIN": -32768, "SSIZE_MAX": 32767, "TTY_NAME_MAX": 32, "TZNAME_MAX": 6, "UCHAR_MAX": 255, "UINT_MAX": 4294967295, "UIO_MAXIOV": 1024, "ULONG_MAX": 18446744073709551615, "USHRT_MAX": 65535, "WORD_BIT": 32, "_AVPHYS_PAGES": 768366, "_NPROCESSORS_CONF": 2, "_NPROCESSORS_ONLN": 2, "_PHYS_PAGES": 970577, "_POSIX_ARG_MAX": 2097...