Powered By Blogger

Wednesday, October 12, 2016


IBM UrbanCode Deploy


IBM UrbanCode Deploy is a tool for automating application deployments through your environments. It is designed to facilitate rapid feedback and continuous delivery in agile development while providing the audit trails, versioning and approvals needed in production.

IBM UrbanCode Deploy provides

  • Automated, consistent deployments and rollbacks of applications
  • Automated provisioning, updating, and de-provisioning of cloud environments
  • Orchestration of changes across servers, tiers and components
  • Configuration and security differences across environments
  • Clear visibility: what is deployed where and who changed what
  • Integrated with middleware, provisioning and service virtualization

Typical Uses
  • Continuous Delivery: Integrate with build and test tools to automatically deploy, test and promote new builds
  • Production Deployments: Orchestrate a complex production deployments of applications and configuration
  • Self-Service: Grant different teams rights to “push the go button” for different applications and environments
  • Incremental Updates: Deploy only the changes components or missing incremental (patch) versions
IBM Udeploy lifecycle 


Friday, August 12, 2016

Chef Installation Step by Step Guide 
download chef server RPM

wget https://packages.chef.io/stable/el/7/chef-server-core-12.8.0-1.el7.x86_64.rpm
wget https://packages.chef.io/stable/el/7/chef-12.12.15-1.el7.x86_64.rpm
Extract and Install using RPM

rpm -Uvh chef-11.16.2-1.el6.x86_64.rpm
rpm -Uvh chef-12.12.15-1.el7.x86_64.rpm
Edit your hostname in


vi /etc/hosts
<IP ADDRESS> <HOSTNAME>
Configure Chef

chef-ctl-reconfigure

The above will configure chef server , generate base cookbooks, create SSL, give chef-server name wrt /etc/host entries

Now create admin and create pem
chef-server-ctl user-create admin <name> <lastname> <email> <password> -f admin.pem
chef-server-ctl org-create  <create-org> <'orgname'> --association_user admin -f <orgname>.pem
 Install git
yum install git -y
Clone base repo from git
git clone https://github.com/chef/chef-repo.git
download and install chef developer kit


wget https://packages.chef.io/stable/el/7/chefdk-0.15.16-1.el7.x86_64.rpm
rpm -Uvh chefdk-0.15.16-1.el7.x86_64.rpm
Verify Chef server
chef verify
add bin to your profile
echo 'eval "$(chef shell-init bash)"' >> ~/.bash_profile
source ~/.bash_profile
Copy .pem files to chef repo
cp admin.pem <org>.pem  ~/chef-repo/.chef/
cp admin.pem <org>.pem  /root/.chef/
Configure your knife

[root@Chef-Server .chef]# vi knife.rb
current_dir = File.dirname(__FILE__)
log_level                :info
log_location             STDOUT
node_name                "admin"
client_key               "#{current_dir}/admin.pem"
validation_client_name   "<ORG VALIDATOR>"
validation_key           "#{current_dir}/<orgkey>.pem"
chef_server_url          "https://<Chef-server>/organizations/<organisatio>"
syntax_check_cache_path  "#{ENV['HOME']}/.chef/syntaxcache"
cookbook_path            ["#{current_dir}/../cookbooks"]
wq!
cd ~/chef-repo
knife ssl fetch
knife client list
knife node list 
This will list the nodes registered with chef server 

Bootstrap Chef client
knife bootstrap NODENAME
It will run successful as no recipe / run list is added to host. 


export EDITOR=vi
knife  node edit <NODENAME>
Now add the run list to newly added client  and then run chef-client :) 


"recipe[name_of_recipe]"
##Run chef receipe from remote 
You could use knife ssh to run chef-client on all boxes that contain a certain role or recipe:

knife ssh "role:web" "sudo chef-client" -x ubuntu --sudo 

Or if you're in EC2:

knife ssh "role:web" "sudo chef-client" -x ubuntu -a ec2.public_hostname 


knife ssh name:mynode -a ipaddress  -x ubuntu -i mycredentials.pem "sudo chef-client"You could use knife ssh to run chef-client on all boxes that contain a certain role or recipe:

##Bootstrap Remote node

knife bootstrap new-host-ip -x root -P password -N node_name


#To add a role or recipe to a node
knife node run_list add node_name "recipe[cookbook::recipe]"
knife node run_list add node_name "role[role_name]"
knife node run_list add node_name "role[role_name],recipe[cookbook::recipe]"
Chef- Knife commands cheat sheet
knife commands:
knife cookbook create apache — to create cookbook
knife cookbook upload apache — to upload cookbook to chef-server
knife node run_list add NODENAME “recipe[NAME]” — to add receipe as a runlist to node
knife node run_list add NODENAME -b “recipe[NAME]” “recipe[NAMEOFUPLOADING]” — to add a recipe before partcular recipe- useful comamnd to define the preecedence of recipes in a runlist
knife -h == knife help command
knife node show NODENAME -a attribites(a-b-c-d)0- commanmd to show the attributes of the node
knife search node “os:linux” — search for node which are linux nodes
knife search node “os:linux” -a platform — search for niode which are linux nodes and shows playtform
knife search node “os:linux” -a linux.model give me the result of linux as linux.model =ubuntu as output
chef-client — command to run on node called as convergence.
knife environment list -w — to show all the enviroment
knife environment compare dev
knife environment compare dev prod — compare environments between dev and prod
knife environment compare — all -to compare all receipes in server across all environments.
knife environment delete dev -to delete env
knife environment show dev — shows environment information.
kniofe role create role_name — command to create new role
 knife role from file chef-repo/roles/rolename.rb — upload role(rolename.rb) to server
knife role list -w — list all roles in chef server
knife role delete role_name — delete the new role
knife node run_list add linuxnode “role[webserver]” — assign role(web server)to a node(linuxnode)
As similar to roles — we use base role.
create a base role — and we can use include that base role to all roles runlist. so if you need to update any roles with new runlist. All you need to change is the base role list.
 Chef- Knife commands cheat sheet
knife commands:
knife cookbook create apache — to create cookbook
knife cookbook upload apache — to upload cookbook to chef-server
knife node run_list add NODENAME “recipe[NAME]” — to add receipe as a runlist to node

knife node run_list add NODENAME -b “recipe[NAME]” “recipe[NAMEOFUPLOADING]” — to add a recipe before partcular recipe- useful comamnd to define the preecedence of recipes in a runlist
knife -h == knife help command
knife node show NODENAME -a attribites(a-b-c-d)0- commanmd to show the attributes of the node
knife search node “os:linux” — search for node which are linux nodes
knife search node “os:linux” -a platform — search for niode which are linux nodes and shows playtform
knife search node “os:linux” -a linux.model give me the result of linux as linux.model =ubuntu as output
chef-client — command to run on node called as convergence.
knife environment list -w — to show all the enviroment
knife environment compare dev
knife environment compare dev prod — compare environments between dev and prod
knife environment compare — all -to compare all receipes in server across all environments.
knife environment delete dev -to delete env
knife environment show dev — shows environment information.
kniofe role create role_name — command to create new role
 knife role from file chef-repo/roles/rolename.rb — upload role(rolename.rb) to server
knife role list -w — list all roles in chef server
knife role delete role_name — delete the new role
knife node run_list add linuxnode “role[webserver]” — assign role(web server)to a node(linuxnode)
As similar to roles — we use base role.
create a base role — and we can use include that base role to all roles runlist. so if you need to update any roles with new runlist. All you need to change is the base role list.


Wednesday, May 11, 2016

Che-Solo ( Continious deployment tool for Beginers)

Chef:
Chef is configuration management tool use in IT Industry to manage infrastructure as a code
Below diagram will help you understand what chef is for.  However , to start learning chef it is recomanded to use chef-solo



 Chef-Solo:
Its standalone version of chef , mainly used for learning and testing of chef deployments

Installation Of Chef -Solo
Below are steps to install chef-solo and knife plugin on centos-7*

Chef-Solo
Installation of CHEF-SOLO (CHef Standalone)

#yum update
#yum install gcc-c++ patch readline readline-devel zlib zlib-devel
#yum install libyaml-devel libffi-devel openssl-devel make
#yum install bzip2 autoconf automake libtool bison iconv-devel sqlite-devel

Dependencies are installed
#curl -sSL https://get.rvm.io | bash -s stable

Get Stable Ruby Version manager
#source /etc/profile.d/rvm.sh
#rvm install 2.1.8
#rvm use 2.1.8 --default
#ruby --version

Ruby Installation is completed
#mkdir chef
#cd chef

direcorty named chef is created to store all chef conf, cookbooks etc
#knife solo init .
#knife solo prepare root@Centosbase
#knife solo prepare root@localhost
#knife solo cook root@localhost
#knife solo bootstrap root@localhos


 VOILA , you chef-solo instance is ready , 

In next chapter we will deploy LAMP  stack using chef