You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the PR i have created to address the issue: #343
And here's some background:
the only_if block is being evaluated very early in a chef run. So early that my wrapper cookbooks have not yet been evaluated.
This is problematic because i use a wrapper cookbook to set the value of node["percona"]["server"]["replication"]["host"] in attributes.
But, because percona cookbook is included (and it's ruby evaluated) before my cookbook has an opportunity to insert data into the node["percona"]["server"]["replication"]["host"] map the call server["replication"]["host"] != "" || server["role"].include?("master") evaluates to false.
by putting a lazy{} block in the only if block, the chef-client will not make a decision about weather or not to render the SQL template until after all attributes have been loaded, during the converge phase instead of the compile phase.
The text was updated successfully, but these errors were encountered:
If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help!
Howdy.
This is the PR i have created to address the issue:
#343
And here's some background:
the
only_if
block is being evaluated very early in a chef run. So early that my wrapper cookbooks have not yet been evaluated.This is problematic because i use a wrapper cookbook to set the value of
node["percona"]["server"]["replication"]["host"]
in attributes.But, because
percona
cookbook is included (and it's ruby evaluated) before my cookbook has an opportunity to insert data into thenode["percona"]["server"]["replication"]["host"]
map the callserver["replication"]["host"] != "" || server["role"].include?("master")
evaluates tofalse
.by putting a
lazy{}
block in theonly if
block, thechef-client
will not make a decision about weather or not to render the SQL template until after all attributes have been loaded, during the converge phase instead of the compile phase.The text was updated successfully, but these errors were encountered: