Setup Chef on standalone PowerKVM Environment

1) What it is?

Chef simplifies the way you perform infrastructure automation and configuration management tasks. The standalone installation of the Chef  creates a working installation on a single server.   This setup is on  standalone environment on PowerKVM node. (No separate chef server is configured.)

2) How to install on powerkvm node.

yum search chef
============================================================================== N/S matched: chef ===============================================================================
chef.ppc64 : The full stack of chef

yum install chef.ppc64

3) Configuration files:

web.json:   This is a pointer to recipe, which user would like to run.

solo.rb: only sets two paths for Chef Solo.

default.rb: sample recipe which user would like to run. User need to keep adding recipes  as per his/her requirements

3.1) Example Cookbook  to start kimchid service on powerkvm.

cat /root/chef-repo/cookbooks/demo/recipes/default.rb

#
# Cookbook Name:: demo
# Recipe:: default
#
# Copyright 2014, YOUR_COMPANY_NAME
#
# All rights reserved – Do Not Redistribute
#

package ‘kimchi’ do
action :install
end

service ‘kimchid’ do
action [  :enable, :start ]
end

3.2) chef.solo

cat chef-repo/solo.rb
file_cache_path “/root/chef-solo”
cookbook_path “/root/chef-repo/cookbooks”

3.3) web.json

cat web.json
{
“run_list”: [ “recipe[demo]” ]
}

4) How to run

chef-solo  -c chef-repo/solo.rb -j web.json
[2014-09-16T13:42:49+01:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.

To fix this issue add an entry like this to your configuration file:

“`
# Verify all HTTPS connections (recommended)
ssl_verify_mode :verify_peer

# OR, Verify only connections to chef-server
verify_api_cert true
“`

To check your SSL configuration, or troubleshoot errors, you can use the
`knife ssl check` command like so:

“`
knife ssl check -c chef-repo/solo.rb
“`

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Starting Chef Client, version 11.12.8
Compiling Cookbooks…
Converging 2 resources
Recipe: demo::default
* package[kimchi] action install (up to date)
* service[kimchid] action enable
   – enable service service[kimchid]

* service[kimchid] action start (up to date)

Running handlers:
Running handlers complete

Chef Client finished, 1/3 resources updated in 4.874421085 seconds

Advertisements

One thought on “Setup Chef on standalone PowerKVM Environment

  1. Pingback: Bring Up PowerKVM | Pradeep K Surisetty

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s