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

Terraform, a set of some small fixes, using absolute/relative path, and complex variable types #53909

Open
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@nolte
Copy link

commented Mar 16, 2019

SUMMARY

Handle the Location of the generated Local Terraform State and Plan Files, used the Ansible Terraform Module.

At the moment the Module has problems with absolut and relative path, when you use the state_file or plan_file option. A better handling will Fixes #43405 and #43407.

Another fix is, handling complex variable types like list or map, see #51687, here was the problem, that the variables need a double quotes, now the source is not nice but runs.

Add a one more example for Fixes #49115

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

terraform

ADDITIONAL INFORMATION

You find a example for reproduce the different Issues at nolte/ansible-terraform-example.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2019

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

test/units/modules/cloud/misc/test_terraform.py:10:28: bad-whitespace Exactly one space required after comma     ("/tmp/testplan.tfpalan","/tmp/testplan.tfpalan"),                             ^
test/units/modules/cloud/misc/test_terraform.py:11:23: bad-whitespace Exactly one space required after comma     ("testplan.tfpalan","terraform_modules/module_tc_0_0_no_config/testplan.tfpalan"),                        ^
test/units/modules/cloud/misc/test_terraform.py:16:34: undefined-variable Undefined variable 'convertOsLookupPath'
test/units/modules/cloud/misc/test_terraform.py:20:8: bad-whitespace Exactly one space required after comma     ("1",'"1"'),         ^
test/units/modules/cloud/misc/test_terraform.py:21:6: bad-whitespace Exactly one space required after comma     (1,'"1"'),       ^
test/units/modules/cloud/misc/test_terraform.py:22:8: bad-whitespace Exactly one space required after comma     ([1],'["1"]'),         ^
test/units/modules/cloud/misc/test_terraform.py:23:7: bad-whitespace Exactly one space required after comma     ([1,2,3],'["1","2","3"]'),        ^
test/units/modules/cloud/misc/test_terraform.py:23:9: bad-whitespace Exactly one space required after comma     ([1,2,3],'["1","2","3"]'),          ^
test/units/modules/cloud/misc/test_terraform.py:23:12: bad-whitespace Exactly one space required after comma     ([1,2,3],'["1","2","3"]'),             ^
test/units/modules/cloud/misc/test_terraform.py:24:9: bad-whitespace Exactly one space required after comma     (["1","2","3"],'["1","2","3"]'),          ^
test/units/modules/cloud/misc/test_terraform.py:24:13: bad-whitespace Exactly one space required after comma     (["1","2","3"],'["1","2","3"]'),              ^
test/units/modules/cloud/misc/test_terraform.py:24:18: bad-whitespace Exactly one space required after comma     (["1","2","3"],'["1","2","3"]'),                   ^
test/units/modules/cloud/misc/test_terraform.py:25:29: bad-whitespace No space allowed before bracket     ({'content': 'myExample' },'{ content = "myExample" }'),                              ^
test/units/modules/cloud/misc/test_terraform.py:25:30: bad-whitespace Exactly one space required after comma     ({'content': 'myExample' },'{ content = "myExample" }'),                               ^
test/units/modules/cloud/misc/test_terraform.py:26:61: bad-whitespace No space allowed before bracket     ({'content': 'myExample', 'target_name': '/tmp/test.txt' },'{ content = "myExample", target_name = "/tmp/test.txt" }')                                                              ^
test/units/modules/cloud/misc/test_terraform.py:26:62: bad-whitespace Exactly one space required after comma     ({'content': 'myExample', 'target_name': '/tmp/test.txt' },'{ content = "myExample", target_name = "/tmp/test.txt" }')                                                               ^
test/units/modules/cloud/misc/test_terraform.py:30:23: undefined-variable Undefined variable 'convertPythonVarValueToTerraformVarCommandlineParameter'

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

lib/ansible/modules/cloud/misc/terraform.py:229:0: dangerous-default-value Dangerous default value [] as argument
lib/ansible/modules/cloud/misc/terraform.py:229:29: bad-whitespace Exactly one space required after comma def _variables_args(variables,variables_file=[]):                              ^
lib/ansible/modules/cloud/misc/terraform.py:241:29: bad-whitespace No space allowed before comma def convertOsLookupPath(path , project_path):                              ^
lib/ansible/modules/cloud/misc/terraform.py:251:17: bad-whitespace Exactly one space required after comma         for index,val in enumerate(varValue):                  ^
lib/ansible/modules/cloud/misc/terraform.py:413:70: bad-whitespace No space allowed before :     if (state != 'present') or (state == 'present' and not plan_file) :                                                                       ^

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

lib/ansible/modules/cloud/misc/terraform.py:215:7: E111 indentation is not a multiple of four
lib/ansible/modules/cloud/misc/terraform.py:216:7: E111 indentation is not a multiple of four
lib/ansible/modules/cloud/misc/terraform.py:217:11: E111 indentation is not a multiple of four
lib/ansible/modules/cloud/misc/terraform.py:229:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/misc/terraform.py:229:30: E231 missing whitespace after ','
lib/ansible/modules/cloud/misc/terraform.py:241:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/misc/terraform.py:241:29: E203 whitespace before ','
lib/ansible/modules/cloud/misc/terraform.py:242:6: E111 indentation is not a multiple of four
lib/ansible/modules/cloud/misc/terraform.py:242:6: E117 over-indented
lib/ansible/modules/cloud/misc/terraform.py:243:10: E111 indentation is not a multiple of four
lib/ansible/modules/cloud/misc/terraform.py:244:6: E111 indentation is not a multiple of four
lib/ansible/modules/cloud/misc/terraform.py:245:10: E111 indentation is not a multiple of four
lib/ansible/modules/cloud/misc/terraform.py:247:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/misc/terraform.py:251:18: E231 missing whitespace after ','
lib/ansible/modules/cloud/misc/terraform.py:254:40: E225 missing whitespace around operator
lib/ansible/modules/cloud/misc/terraform.py:257:19: E226 missing whitespace around arithmetic operator
lib/ansible/modules/cloud/misc/terraform.py:257:29: E226 missing whitespace around arithmetic operator
lib/ansible/modules/cloud/misc/terraform.py:262:36: E222 multiple spaces after operator
lib/ansible/modules/cloud/misc/terraform.py:263:36: E225 missing whitespace around operator
lib/ansible/modules/cloud/misc/terraform.py:267:20: E226 missing whitespace around arithmetic operator
lib/ansible/modules/cloud/misc/terraform.py:267:30: E226 missing whitespace around arithmetic operator
lib/ansible/modules/cloud/misc/terraform.py:271:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/misc/terraform.py:272:16: E226 missing whitespace around arithmetic operator
lib/ansible/modules/cloud/misc/terraform.py:272:33: E226 missing whitespace around arithmetic operator
lib/ansible/modules/cloud/misc/terraform.py:274:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/cloud/misc/terraform.py:413:70: E203 whitespace before ':'
test/units/modules/cloud/misc/test_terraform.py:10:29: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:11:24: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:20:9: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:21:7: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:22:9: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:23:8: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:23:10: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:23:13: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:24:10: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:24:14: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:24:19: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:25:29: E202 whitespace before '}'
test/units/modules/cloud/misc/test_terraform.py:25:31: E231 missing whitespace after ','
test/units/modules/cloud/misc/test_terraform.py:26:61: E202 whitespace before '}'
test/units/modules/cloud/misc/test_terraform.py:26:63: E231 missing whitespace after ','

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2019

@nolte nolte force-pushed the nolte:devel branch to f99df47 Mar 16, 2019

@nolte nolte marked this pull request as ready for review Mar 16, 2019

@Akasurde Akasurde self-assigned this Mar 17, 2019

@ansibot ansibot removed the needs_triage label Mar 17, 2019

@ansibot ansibot added the stale_ci label Mar 25, 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.