Tag Archives: Orchestration

chef attribute : avoiding “undefined method `[]’ for nil:NilClass” error

In chef, when a nested attribute that might not exist/or not crated yet, you can use rescue as a modifier to an if statement. For example, assuming that only some of your nodes have node[‘install_wls’][‘isManaged’]defined: if node[‘install_wls’][‘isManaged’] do the stuff … Continue reading

Posted in ARTICLES, Configurtion management, DevOps, HOWTO | Tagged , , , , | Leave a comment

Knife remove all recipes from the run_list

There is a simple knife command which can be used to remove all recipes from the run_list of all nodes in a environment. For this you have to create a dummy role like suppose dummy_role. #knife role create dummy_role Once … Continue reading

Posted in ARTICLES, DevOps, HOWTO, TIPS & T RICS | Tagged , , | Leave a comment

Chef – Create encrypted data bag and keep secrets

Sometimes we have to deal with global variables like User passwords, database password, API Keys, middleware boot properties in our chef recipes which shouldn’t be exposed outside. One solution is we have to keep all the secrets in a data … Continue reading

Posted in ARTICLES, DevOps, HOWTO, OperatingSystem, Programming, SCRIPTING | Tagged , , , , | 1 Comment

Chef – Deleting existing attributes

Sometimes we face situation like : May need to remove some persistent attributes which we set a flag after some work is done May be we set some attributes wrong so need to remove and reset the existing attribute. The … Continue reading

Posted in ARTICLES, DevOps, HOWTO, TIPS & T RICS | Tagged , , , , | Leave a comment

Writing chef Library

In many cases we have to reuse same code again and again in our recipes. So to reduce this we can write our own library module and reuse it’s methods whenever required. This can help us use our own custom … Continue reading

Posted in ARTICLES, DevOps, HOWTO, Programming, SCRIPTING, TIPS & T RICS, TUTORIALS | Tagged , , , , , , | Leave a comment

Chef/ruby way – Read a file and expose as environment variable

Many time we have to read a property file in in which the variable and value are comma separated and we have to set those in our environment variable to execute certain recipes.   e.g. property file (/u01/data/wor/app/conf/conf.prop) ops_home = … Continue reading

Posted in ARTICLES, DevOps, HOWTO, Programming, TUTORIALS, Uncategorized | Tagged , , , , , | Leave a comment

Puppet Quick Tutorial with examples

Puppet Version Used : 3.8 Distro Used : RHEL,CentOS, OEL 1. Puppet master : Get the repo with below link. rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm install the master yum install puppet-server Enter the master server hostname in the puppet.conf file under [main] … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment