Search code examples
chef-infralwrp

can chef lwrp return the answer as variable (false or true) for later use in a recipe?


So the question is simple. Can I get the answer if my lwrp did the change as false or true? I know that it's visible in Chef Logs, but my idea is to use the results later in a recipe code.


Solution

  • No, resources do not have "output" values. That said, you can do something like store a value in node.run_state[:foo] which is a global hash visible from all levels of the converge. There is a reason that mutable global values are a cliche though, they really are terrible to maintain.