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

ohpc_hosts not updated on apply #2

Closed
sjpb opened this issue Jan 22, 2020 · 0 comments
Closed

ohpc_hosts not updated on apply #2

sjpb opened this issue Jan 22, 2020 · 0 comments

Comments

@sjpb
Copy link

sjpb commented Jan 22, 2020

The ohpc_hosts file is not updated on apply. Turns out behavior of data resources is very non-obvious in terms of when they get refreshed and is described in TF issue 17034.

The fix is to have:

data  "template_file" "ohpc" {
    ...
    depends_on = [openstack_compute_instance_v2.compute]
}

This forces the template_file data resource to always be updated, and in turn the ohpc_hosts file (local_file.hosts resource) always gets updated as it (implicitly) depends on the template_file data file resource. Note that adding the same depends_on directly to the local_file.hosts resource does not work, as it doesn't think the data its templating out has been changed.

The "always-update" behavior for the data resource with the depends_on is described as somewhat undesirable behavior in the above link but in this case it is what we want.

Fix will be applied in eiffel branch commit 4d052c4ef5c9b946277088f992a371f7aa1acff8 but wanted to have somewhere to discuss this.

@sjpb sjpb closed this as completed Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant