rundeck/terraform-provider-rundeck

request to pass Terraform variable values to Rundeck jobs in runtime

cwaltherf opened this issue · 1 comments

This is a feature request:

The request is to pass the values of the variables that are defined in Terraform variable file (for example "vars.tfvars") to Rundeck jobs in run time.
Each time a variable key="value" is modified in Terraform "vars.tfvars" to key="val2" the value should automatically be reflected in Rundeck run time, without having to perform terraform apply command before.

I'll paste an example here creating a Rundeck job with Terraform on an existing project named the "terraform" plugin.

Basic Example:

  1. create a project in Rundeck named "terraform_plugin"

  2. In terraform create a "vars.tfvars" file and provide a value for the variable. The variable here is "example_var="value2""
    image

  3. create a .tf file ("job.tf") to buld a job
    The job has 3 Command steps, and the third step will echo the value of "${var.example_var}"
    image

  4. Run:

  5. $terraform init

  6. $terraform apply -var-file="vars.tfvars" -var-file="variables.tfvars"
    7.Go to jobs in the Rundeck Gui and see the job definition
    image
    8.Run the job and see it's aoutput of the third step equals value
    image

  7. Modyfy the value of the "example_var=val" to "example_var=val2"
    cristian@cristian-Inspiron-15-7000-Gaming:~/cris/terraform_rundeck$ cat vars.tfvars
    example_var="value2"

Run the job again and you'll see that the change for the value of "example_var" is not reflected.

  1. It necessary to run Terraform apply again to reflect the new value for the variable
    image

  2. Now that the changes have been applied, you can see at the job definition or running the job that the new value is correctly reflected.
    image

Since these variable values are modified by a lot of users every time they un a job, create a project, a resource model or whatever, it's been request that Rundeck can refresh these values wthout having to update the job form Terraform each time.

closed as request changed, see #70