Friday, April 18, 2014

Chef Server - Installation & Configuration

1)      Download the latest:
2)      Install using RPM:
$ rpm -ivh chef-server-11.0.10-1.el6.x86_64.rpm
3)      Set the hostname in server and also in DNS server:
                $ hostname chef-server.np.lnawsapps.co.uk
                $ vi /etc/sysconfig/network
                $ vi /etc/hosts
                $ reboot
4)      If you are using some Operating system whose entry is not in Chef configuration then need to add. Let’s assume of Amazon OS:
$ vi /opt/chef-server/embedded/cookbooks/runit/recipes/default.rb
                 case node["platform"]
                when "ubuntu"
                  include_recipe "runit::upstart"
                when "redhat","centos","rhel","scientific","amazon"                                                      #### this needs to be changed - add amazon
                  if node['platform_version'] =~ /^6/
                                include_recipe "runit::upstart"  
                  else
                                include_recipe "runit::upstart"                   #### this needs to be changed
                  end
                else
                  include_recipe "runit::sysvinit"
                end
5)      Then run chef configure command:
 $ chef-server-ctl reconfigure
                (may take a while as will configure all bits)
6)      Custom configurations- create this file and paste below lines.
[root@chef-server ~]# cat /etc/chef-server/chef-server.rb
                server_name = "chef-server.yourdomain.co.uk"                                              ## change this line
                api_fqdn server_name
                nginx['url'] = "https://#{server_name}"
                nginx['server_name'] = server_name
                lb['fqdn'] = server_name
                bookshelf['vip'] = server_name
                erchef[‘s3_url_ttl’] = 3600
[root@chef-server ~]#
7)      Then again run chef configure command:
$  chef-server-ctl reconfigure

8)      Verify :
i.                    Installation:
                $ chef-server-ctl test
ii.                  Services:
                $ /opt/chef-server/bin/chef-server-ctl service-list
                $ /opt/chef-server/bin/chef-server-ctl status
                $ /opt/chef-server/bin/chef-server-ctl test


1 comment: