Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the only_if call in replication recipe ignores configuration done by cookbooks later in the run list #344

Closed
kquinsland opened this issue Nov 4, 2015 · 2 comments

Comments

@kquinsland
Copy link

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 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.

@xorima
Copy link
Contributor

xorima commented May 11, 2019

Closing due to inactivity.

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!

Thanks,
Sous-Chefs

@xorima xorima closed this as completed May 11, 2019
@lock
Copy link

lock bot commented May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants