terraform: Add parameter for plan file

Add terraform_plan parameter to be defined when using apply
command. It allows to specify a plan file to apply.

Change-Id: I2858317e4dd560030a367b2cd2ac43db5585152a
This commit is contained in:
Denis Fortin 2020-08-18 10:14:17 +02:00 committed by Denis
parent 620c95e4a3
commit 1a806f04e2
3 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,10 @@ Run terraform command. Assumes the appropriate version of terraform has been ins
String of extra command line options to pass to terraform.
.. zuul:rolevar:: terraform_plan
Optional. Path to the plan file to use when using 'apply' command.
.. zuul:rolevar:: terraform_workspace
Name of the workspace to operate against.

View File

@ -1,5 +1,6 @@
terraform_executable: "{{ ansible_user_dir }}/.local/bin/terraform"
terraform_extra_args: ""
terraform_plan: ""
terraform_create_workspace: false
terraform_purge_workspace: false
terraform_comment: true

View File

@ -59,6 +59,7 @@
-input=false
{{ terraform_extra_args }}
{% if terraform_command == 'apply' or terraform_command == 'destroy' %}-auto-approve{% endif %}
{{ terraform_plan }}
args:
chdir: "{{ zuul_work_dir }}"
environment: