Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request to pass Terraform variable values to Rundeck jobs in runtime #67

Closed
cwaltherf opened this issue Apr 2, 2021 · 1 comment
Closed

Comments

@cwaltherf
Copy link

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.

@jtobard
Copy link

jtobard commented Jun 17, 2021

closed as request changed, see #70

@jtobard jtobard closed this as completed Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants