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

How to pass an option to an inline_script defined in rundeck_job #118

Open
ronaldoafonsoncsa opened this issue Nov 7, 2023 · 0 comments

Comments

@ronaldoafonsoncsa
Copy link

Hi all,

I'm using the rundeck terraform provider and I need to pass a variable or option to an inline_script that I added to a job workflow. I was not able to find that argument for the rundeck_job resource so I started wondering if that kind of argument really exists.

In the UI I can configure a parameter like "${option.NAME}", so the command will end up executing like: echo.sh ${option.NAME}.
I just don't know how to do the same using Terraform code.

Terraform Version

Terraform v1.3.7
on linux_amd64

Affected Resource(s)

  • rundeck_job

Terraform Configuration Files

resource "rundeck_job" "echo" {
  name                         = "echo"
  project_name            = rundeck_project.name
  description                 = "Echo a name"
  schedule_enabled     = false
  schedule                    = ""
  node_filter_query       = "some-nodes-.*"
  node_filter_exclude_query   = ""
  allow_concurrent_executions = true
  max_thread_count            = 10

  command {
    inline_script = file("${path.module}/scripts/echo.sh")
  }

  option {
    name     = "NAME"
    required = true
  }
}

Debug Output

There is no error since it seems that this functionality is not supported by the Rundeck Terraform module. I guess.

Panic Output

There is no panic.

Expected Behavior

I was expecting the echo.sh command to be executed like echo.sh ${option.NAME}.

Actual Behavior

The echo.sh command is being executed like: echo.sh (no parameter is passed to the echo.sh shell script).

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

1 participant