Friday, June 8, 2012

Deploying OpenERP with Chef

What is Chef -
Chef is an open-source systems integration framework built specifically for automating the cloud.
With Chef, you write abstract definitions as source code to describe how you want each part of your infrastructure to be built, and then apply those descriptions to individual servers.
The result is a fully automated infrastructure: when a new server comes on line, the only thing you have to do is tell Chef what role it should play in your architecture.
Chef is a systems integration framework, built to bring the benefits of configuration management to your entire infrastructure. 

With Chef, you can: 
  • Manage your servers by writing code, not by running commands. (via Cookbooks) 
  • Integrate tightly with your applications, databases, LDAP directories, and more. (via Libraries) 
  • Easily configure applications that require knowledge about your entire infrastructure ("What systems are running my application?" "What is the current master database server?") (via Search) 
  • Create perfect clones of QA environments , pre-production environments, partner preview environments and more. (via Environments
Once automated, you hold a blueprint for your infrastructure, enabling you to build, or rebuild, automatically in minutes or hoursnot weeks or months. Better still, when you take those environments live and reality intrudes - which, trust us, it will - Chef gives you endless flexibility to adapt on the fly. 
Install Openerp on new server  
We have to first migrate the required files on the target server by using following command 

knife prepare ubuntu@ip
We have created Chef  for automatic installation of  OpenERP and Postgesql. In this chef, we are going to download all modules form the OpenERP Website with latest version, for now we are using  OpenERP 6.0.4  version.
Fristly We install all the Python dependencies for OpenERP by writing recipes in the cookbooks,
Python modules required.
  1. python-psycopg2
  2. python-lxml
  3. python-dateutil
  4. python-cherrypy
  5. python-formencode
  6. python-pydot
  7. python-setuptools
  8. python-lxml
  9. python-mako
Then we are going for the Postgresql installation,
For installing Postgresql 9.1 we have written recipes and with this it also created userUbuntuin your postgresql.
We fetch OpenERP source form launchpad and install that on the server
If you have own branch or any other version control you can pull the code from there.
Once this installations finishes, we are going to make services for the OpenERP in the /etc/init.d/ by the coping files openerp-server.sh and openerp-web.sh.
Here is how recipe look like
#
# Cookbook Name:: OpenERP server
# Recipe:: default
#
# Copyright 2012, Pragmatic TechSoft
#
# All rights reserved - Do Not Redistribute
#
#########################################
#
#                    recipes for the postgresql
#
#########################################
package "postgresql"
service "postgresql" do
supports [:status]
action  :start
end

No comments:

Post a Comment