Tag Archives: chef

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

chef knife tricks: Add a node in an environment

  Sometime during automation of a large deployment process, we have to bootstrap a node , create environment and add the node in that particular environment on the fly.   Bootstraping : 2. Create environment dynamically from inside the programme:(python … Continue reading

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

Chef Recipe: Oracle DB 11gR2 EE silent deploy

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 … Continue reading

Posted in ARTICLES, DevOps, HOWTO, Operations, Private Cloud, Programming, Public Cloud, TUTORIALS | 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