1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Terraform module: pass plan_file argument correctly

Per #39611 the `terraform` module wasn't properly building plan-only
files.
This commit is contained in:
Ryan S. Brown 2018-05-02 11:25:52 -04:00
parent 0a119c391a
commit 9a607283aa

View file

@ -255,7 +255,7 @@ def main():
needs_application, changed = True, True
if state == 'planned':
plan_file, needs_application = build_plan(command[0], project_path, variables_args, state_file)
plan_file, needs_application = build_plan(command[0], project_path, variables_args, state_file, plan_file)
if state == 'absent':
# deleting cannot use a statefile
needs_application = True
@ -266,7 +266,7 @@ def main():
elif plan_file and not os.path.exists(plan_file):
module.fail_json(msg='Could not find plan_file "{0}", check the path and try again.'.format(plan_file))
else:
plan_file, needs_application = build_plan(command[0], project_path, variables_args, state_file)
plan_file, needs_application = build_plan(command[0], project_path, variables_args, state_file, plan_file)
command.append(plan_file)
if needs_application and not module.check_mode and not state == 'planned':