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
Post a Comment