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

Fix using Terraform with given state_file parameter (#43405) #53607

Closed
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
3 participants
@nolte
Copy link

nolte commented Mar 10, 2019

SUMMARY

Handle the Location of the generated Local Terraform State File, used the Ansible Terraform Module.

The state_file must not exists at the state planned, only for the state absent the state_file must exists.

Using the Terraform apply command with state-out-path, so the used state_file are updated, and no terraform.tfstate will generated to the project_path directory, this make the Terraform Project reuseable.

Fix the Path for the Plan file lookup.

This Changes are fixing #43405

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

terraform

ADDITIONAL INFORMATION

You find a example at nolte/ansible-terraform-example, the Playbook use a configured state_file with the ansible states, planned, present and absent.

@nolte nolte force-pushed the nolte:fix/terraform-relative-stat-path-43405 branch 2 times, most recently from 8c305a1 to e20fe8c Mar 10, 2019

@nolte nolte closed this Mar 10, 2019

@nolte nolte reopened this Mar 10, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 10, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 12, 2019

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/modules/cloud/misc/terraform.py:189:22: bad-whitespace Exactly one space required around assignment             check_path=state_file                       ^
lib/ansible/modules/cloud/misc/terraform.py:191:22: bad-whitespace Exactly one space required around assignment             check_path=project_path+"/"+state_file                       ^

The test ansible-test sanity --test pep8 [explain] failed with 4 errors:

lib/ansible/modules/cloud/misc/terraform.py:189:23: E225 missing whitespace around operator
lib/ansible/modules/cloud/misc/terraform.py:191:23: E225 missing whitespace around operator
lib/ansible/modules/cloud/misc/terraform.py:191:36: E226 missing whitespace around arithmetic operator
lib/ansible/modules/cloud/misc/terraform.py:191:40: E226 missing whitespace around arithmetic operator

click here for bot help

@nolte nolte force-pushed the nolte:fix/terraform-relative-stat-path-43405 branch from 18b5b05 to 3ef6554 Mar 12, 2019

@nolte nolte closed this Mar 16, 2019

@nolte nolte deleted the nolte:fix/terraform-relative-stat-path-43405 branch Mar 16, 2019

@nolte

This comment has been minimized.

Copy link
Author

nolte commented Mar 16, 2019

closed the changes the same like #53909

@sivel sivel removed the needs_triage label Mar 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.