Pages

Thursday, September 6, 2018

Configuring a Chef Environment - Chef Server

Share it Please
As discussed earlier In order to configure a chef environment we require 3 machines. I have taken 3 virtual machines with Ip address, 10.131.36.181, 10.131.37.244 and 10.131.37.245. All these 3 machines can be ssh from each other. All necessary configuration like ssh keys etc are configured. I also disabled the firewall in all 3 machines.

1. Configure the 3 machines with hostname as
[root@manja17-I14021 chef]# hostname chefserver.nova.com
[root@manja17-I14022 ~]# hostname chefclient.nova.com
[root@manja17-I14020 .chef]# hostname chefdk.nova.com

2. Add the entries about the ip address in the /etc/hosts file for all 3 machines
10.131.36.181 chefserver.nova.com chefserver
10.131.37.244 chefclient.nova.com chefclient
10.131.37.245 chefdk.nova.com     chefdk

Chef – Server
Lets configure the chef-server (10.131.36.181).

1. Download and Install the chef-server package

[root@manja17-I14021 ~]# wget https://packages.chef.io/stable/el/7/chef-server-core-12.10.0-1.el7.x86_64.rpm

[root@manja17-I14021 ~]# rpm -ivh chef-server-core-*.rpm
warning: chef-server-core-12.10.0-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:chef-server-core-12.10.0-1.el7   ################################# [100%]

2. Configure the chef server using,
[root@manja17-I14021 ~]# chef-server-ctl reconfigure

3. Check the status of the chef components using,
[root@manja17-I14021 ~]# chef-server-ctl status
run: bookshelf: (pid 8223) 969s; run: log: (pid 8266) 968s
run: nginx: (pid 8093) 972s; run: log: (pid 8423) 964s
run: oc_bifrost: (pid 8028) 974s; run: log: (pid 8073) 974s
run: oc_id: (pid 8080) 973s; run: log: (pid 8085) 973s
run: opscode-erchef: (pid 8342) 966s; run: log: (pid 8307) 967s
run: opscode-expander: (pid 8180) 969s; run: log: (pid 8211) 969s
run: opscode-solr4: (pid 8130) 970s; run: log: (pid 8149) 970s
run: postgresql: (pid 7999) 975s; run: log: (pid 8013) 974s
run: rabbitmq: (pid 7890) 976s; run: log: (pid 7881) 976s
run: redis_lb: (pid 7506) 988s; run: log: (pid 8403) 965s

4. Create a admin user
[root@manja17-I14021 ~]# chef-server-ctl user-create admin admin admin admin@nova.local password -f /etc/chef/admin.pem

5. Create a organization
[root@manja17-I14021 ~]# chef-server-ctl org-create nova "NovaCORP, Inc" --association_user admin -f /etc/chef/novacorp-validator.pem

In both the above command we are creating a admin user and a organization with keys too. The keys will be created in the /etc/chef location on the chef-server machine.



No comments :

Post a Comment