Chef - What is meant by 'converge_by' -


i pretty new chef , have started machine , lwrp resource.

while doing lots of reading finding term converge_by.

i searched meaning not getting useful.

can me understand it.

thanks

if write own pure-ruby code modifies system within lwrp want wrap code converge_by. 2 things protects wrapped code not run during why-run mode. , automatically marks resource being updated when runs.

in order resource writing idempotent (and not reported updated on every single run) should typically wrap converge_by in check idempotency.

so like:

use_inline_resources action :doit   unless file.exist("/tmp/doit")     converge_by("creating /tmp/doit")       fileutils.touch("/tmp/doit")     end   end end 

of course core chef resources of work example better written as:

use_inline_resources action :doit   file "/tmp/doit" end 

which serves show first choice should compose action out of other resources, second choice write own converge_by code.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -