Total Hit Counter

Thursday, December 10, 2015

Chef Server install and configure


To get started with installation you must have below things ready.

  • Centos 6.5 installed.
  • Internet connection
  • Stop iptables and selinux.


Step1: Download latest rpm from chef website.

https://downloads.chef.io/chef-server/redhat/

I downloaded chef-server-core-12.3.1-1.el6.x86_64.rpm.

Step2: Now install chef rpm. Execute below command to install chef rpm





Step3: Edit /etc/hosts file and add chef-server fqdn to get it resolved. Chef server fqdn must be resolved from anywhere in you network.

127.0.0.1 chef-server.cignex.com

Create file /etc/opscode/chef-server.rb with below content

server_name = "chef-server.cignex.com"api_fqdn server_namebookshelf['vip'] = server_namenginx['url'] = "https://#{server_name}"nginx['server_name'] = server_namenginx['ssl_certificate'] = "/var/opt/opscode/nginx/ca/#{server_name}.crt"nginx['ssl_certificate_key'] = "/var/opt/opscode/nginx/ca/#{server_name}.key"


Step4: Now configure chef server by executing below command
chef-server-ctl reconfigure
At the last you will get message like Chef Server Reconfigured! 


Step5: To start with web console you have to install it.

chef-server-ctl install opscode-manage
 If above command fails then enable yum repo in this file /etc/yum.repos.d/chef-stable.repo
Then install opscode-manage manually and execute above command again.
chef-server-ctl reconfigureopscode-manage-ctl reconfigure
 Now execute below command for installing reporting tool.

chef-server-ctl install opscode-reporting
 If above command fails then enable yum repo in this file /etc/yum.repos.d/chef-stable.repo
Then install opscode-reporting manually and execute above command again.
chef-server-ctl reconfigureopscode-reporting-ctl reconfigure


Step 6: Now restart chef service. by executing below command.
/opt/opscode/bin/chef-server-ctl restart

Step 7:  Create Admin user for login into web console

Command:
chef-server-ctl user-create ADMIN_USER_NAME ADMIN_FIRST_NAME ADMIN_LAST_NAME ADMIN_EMAIL ADMIN_PASSWORD --filename ADMIN_USER_NAME.pem
Example:
[root@chef-server ~]# chef-server-ctl user-create shankar Shankar Patel shankar.patel@cignex.com Cignex --filename Cignex.pem
Reset password for created user
[root@chef-server ~]#  chef-server-ctl password shankar
         
Step 8:  Create Organization to manage nodes under a single roof

Command:
chef-server-ctl org-create ORG_SHORT_NAME "ORG_LONG_NAME" --association_user ADMIN_USER_NAME
Example:
[root@chef-server ~]# chef-server-ctl org-create cignex 'CIGNEX Datamatics Pvt Ltd' --association_user shankar 
You must define organization name in small leters, otherwise it will not create any organization.



Thats it!

You are done now.

Now you can browse URL to login in console

https://chef-server.cignex.com/login



No comments: