Monthly Archives: March 2017

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