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:
parent
0a119c391a
commit
9a607283aa
1 changed files with 2 additions and 2 deletions
|
@ -255,7 +255,7 @@ def main():
|
||||||
needs_application, changed = True, True
|
needs_application, changed = True, True
|
||||||
|
|
||||||
if state == 'planned':
|
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':
|
if state == 'absent':
|
||||||
# deleting cannot use a statefile
|
# deleting cannot use a statefile
|
||||||
needs_application = True
|
needs_application = True
|
||||||
|
@ -266,7 +266,7 @@ def main():
|
||||||
elif plan_file and not os.path.exists(plan_file):
|
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))
|
module.fail_json(msg='Could not find plan_file "{0}", check the path and try again.'.format(plan_file))
|
||||||
else:
|
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)
|
command.append(plan_file)
|
||||||
|
|
||||||
if needs_application and not module.check_mode and not state == 'planned':
|
if needs_application and not module.check_mode and not state == 'planned':
|
||||||
|
|
Loading…
Reference in a new issue