What does convergence mean?

I am new to chefand have just started with the resource machineand LWRP.

While reading, I find the term converge_by. What does it mean?

+4
source share
2 answers

If you write your own pure ruby ​​code that modifies the system in LWRP, then you want to wrap this code with conversion. It does two things that protect the wrapped code so that it doesn't run in a why-run mode. And it automatically marks the resource as updated when it starts.

, , , ( ), .

- :

use_inline_resources
action :doit do
  unless File.exist("/tmp/doit")
    converge_by("creating /tmp/doit") do
      FileUtils.touch("/tmp/doit")
    end
  end
end

, - , :

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

, , , - , , .

+9

, " ". converge_by , .

why-run, , .

+1

Source: https://habr.com/ru/post/1627545/


All Articles