Terraform module: pass `plan_file` argument correctly

Per #39611 the `terraform` module wasn't properly building plan-only
files.
pull/39623/head
Ryan S. Brown 7 years ago
parent 0a119c391a
commit 9a607283aa

@ -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':

Loading…
Cancel
Save