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

add support for remote state in version 0.9 #60

Merged
merged 2 commits into from
Jun 9, 2017

Conversation

ballad89
Copy link
Contributor

This PR adds support for

  • TF_STATE, can be a path to a state file or a path to a terraform root directory
  • If it is a directory it runs terraform state pull which manages both local and remote state as documented here.

I had a look at #PR59 but it I did not like the fact that it only support s3 and talked directly to it

@adammck
Copy link
Owner

adammck commented Mar 24, 2017

Fantastic, thank you! I think this is the best approach, rather than messing with the statefile ourselves. I'll try to get this reviewed and released by the weekend.

@adammck
Copy link
Owner

adammck commented Mar 24, 2017

It looks like terraform state pull works with both remote and local files. Do you think we might be able to always call that, to avoid the distinction?

@ballad89
Copy link
Contributor Author

I was going to suggest that, but was just worried I did not have enough test cases to guarantee it would not break backward compatibility for all the ways people might be using the tool, but i agree terraform state pull would be a more stable solution

@adammck
Copy link
Owner

adammck commented Mar 26, 2017

Your concern is well-founded, but I think the simplification will be worth it. We can do a longer beta period before release, and users can always stick with an older version if we break their workflow. Now that Terraform can fetch and dump the statefile for us, however it's stored, this tool should ideally only be responsible for transforming the JSON into Ansible's INI format.

@ballad89
Copy link
Contributor Author

I totally agree with you. I currently use terraform and ansible extensibly so this tool has been of immense help to me. Let me know if you need help with coding/testing/maintaining.

@e271828-
Copy link

@adammck +1 on this approach, and look forward to the next release.

@lgfa29
Copy link

lgfa29 commented May 25, 2017

I tested this PR on Terraform 0.9.5 using remote state and it worked well. Thanks @ballad89!

@adammck
Copy link
Owner

adammck commented Jun 9, 2017

This could use a little cleaning up, but works for me, and is useful enough that I'm going to stop holding up this PR and merge/release. Thanks very much, and sorry for the delay!

@adammck adammck merged commit 313d404 into adammck:master Jun 9, 2017
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

Successfully merging this pull request may close these issues.

None yet

4 participants