Chef provides a lot of flexibility and greater choice for infrastructure automation and I prefer it over others.
We should design our recipe in such a way that the our recipes without being modified can be used in any environment by maximizing the use of attributes.
I was working on a deployment project on Linux x86-64 platform, where I had to automate all the infra components. Oracle 11g R2 EE is one of them. I will share the cookbook here that can help many other. The recipes written here are used for silent installation of the DB using a response file after pulling the media files from a remote system.
Also the recipes are made idempotent, so that rerunning the cookbook again and again never do any damage. It automatically sets an attribute for DB installed / DB running in chef server after a successful compile -> run of the recipes.
Also the username/passwords are pulled stored and pulled from Encrypted Databag to make it more secure.
Here is the cookbook : https://github.com/kumarprd/Ora11gR2-EE-Silent-Install-Chef-Recipe
The recipes involved use below steps in sequence :
- setupenv.rb (It create the environment that will be used by rest of the recipes)
- oradb.rb (It checks the default attributes to fresh install/patch install and go further for any operations)
- install_oradb.rb ( Install the oracle database in ideompotent manner and sets the attributes in the server)
- create_schema.rb (This is application specific, but I will provide the template that can be modifed)
NOTE : Here create an encryoted databag with below json props which are accessed inside recipes.
Follow my other post : https://thegnulinuxguy.com/2016/08/09/chef-create-encrypted-data-bag-and-keep-secrets/
{
“id”: “apppass”,
“ora_db_passwd”: “dbpass”,
“oracle_pass”: “orapass”}
Any issue/suggestion are welcome.