-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
plan files not portable when using path.module #7927
Comments
@br0ch0n did you find a workaround? I just bumped into the same problem. |
@ringods sadly not really. My current workaround is for my apply (jenkins) job to just ignore the saved plan and blindly apply :( |
On Concourse I had to make sure both plan and apply can find the code in the same absolute path by symlinking. It's easier than in Jenkins because it's all on disposable containers, but still quite smelly... |
This is true also for state files (not only plan files) when, for example, the resource is an This renders remote state useless in a way because a resource in it now contains an attribute with an absolute path from another machine. My current TF version: 0.7.10 |
This is also the case for |
Have you tried this:
|
@xsellier what about files like .zip and other binary data? |
@vamsee sorry for the delay. To archive you can use the archive file provider of terraform |
@xsellier thank you! |
Is there a reason why nobody fixes this? Has anyone looked into a fix for that already? |
Any news on this? |
In the next major release we're going to be normalizing all of the configuration paths to be relative to the current working directory when Terraform is run, rather than absolute as they are today. I think that will take care of this issue "for free", but if not then it'll at least lay the groundwork to fix it more easily and we should be able to fix it shortly afterwards. I've adjusted the labels on this to make sure we'll find it when we're testing the release, and we can see then if the behavior has improved already or if some more work will be required. |
Meanwhile as a workaround I switched to archive file provider |
@apparentlymart when do you expect the next major to land? |
Please unsubscribe me from all communication or provide instructions on how to do so.
Thank You
…Sent from my iPhone
On Oct 3, 2018, at 6:33 PM, Rafael Fonseca ***@***.***> wrote:
@apparentlymart when do you expect the next major to land?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi all, From Terraform 0.12 onwards, Another related change in Terraform 0.12 is that Terraform's path variables always use While there can still be some rough edges if you are running a mode where A more substantial rework of how Terraform deals with the distinction between the root module directory and the current working directory is likely to follow later in a separate issue, but that's beyond the scope of what this issue was representing and so we're going to close this one out now. If you are still seeing inconsistencies between different machines on the same configuration and you are following the recommendation to have |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
It would seem that when using modules and/or "path.module" with saved plans, one ends up with hard-coded module paths inside the saved plan. Since in my case, the resources in question were templates, I had hoped that switching from 'filename' to 'template' would help, but it hasn't. Thus I'm unable to apply my saved plan on a different machine from where I generated it. (e.g. a different Jenkins slave)
Hopefully I'm just doing something wrong and/or there's a workaround.
Terraform Version
0.6.16 - 0.7.0
Affected Resource(s)
core
Terraform Configuration Files
Expected Behavior
Terraform should have used local module paths
Actual Behavior
Terraform was looking for module paths that didn't exist so the apply of the saved plan failed
Steps to Reproduce
References
Likely related to below
#6459
#1439
#7613
The text was updated successfully, but these errors were encountered: