terraform-provider-rundeck icon indicating copy to clipboard operation
terraform-provider-rundeck copied to clipboard

Reference jobs resources are missing flags

Open b0tting opened this issue 1 year ago • 1 comments

When creating a reference job in Rundeck you can pass 4 flags that allow you to modify the way the parent and child job interact.

afbeelding

Especially the first flag is very useful to me. I can set up jobs with a lot of parameters, then reference that jobs and overwrite just a few parameters. At the moment of writing, I cannot find any reference to these four flags in the terraform-provider-rundeck code or the documentation, which feels like they are not implemented.

They are in the job exports from Rundeck, for example, an export with the "Import options" and "Ignore notifications" set:

    commands:
    - jobref:
        group: MyReferenceJobs
        ignoreNotifications: true    
        importOptions: true   
        name: MyChildJob
        useName: 'true'
    keepgoing: false
    strategy: node-first

Terraform Version

Terraform v1.8.3
on windows_amd64
+ provider registry.terraform.io/hashicorp/template v2.2.0
+ provider registry.terraform.io/rundeck/rundeck v0.4.7

Your version of Terraform is out of date! The latest version
is 1.8.5. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

  • rundeck_job.command.job

Terraform Configuration Files

resource "rundeck_job" "child_job" {
  name                      = "my_child_job"
  project_name              = rundeck_project.project.name

  command {
    job {
      name       = rundeck_job.sync_1password_rundeck.name
      group_name = rundeck_job.sync_1password_rundeck.group_name
      import_options = true          # Errors as │ An argument named "import_options" is not expected here.

      }
    }
  }


Expected Behavior

These flags to be accepted and passed into the import file created by the terraform provider

b0tting avatar Jun 07 '24 15:06 b0tting

I would try with something like this:

resource "rundeck_job" "child_job" {
  name                      = "my_child_job"
  project_name              = rundeck_project.project.name

  command {
    job {
      name       = rundeck_job.sync_1password_rundeck.name
      group_name = rundeck_job.sync_1password_rundeck.group_name
      useName = "true"

      }
    }
  }

Where the option values are listed out. Also possible to try the recently released 0.4.8 import option to see what it generates. I may have time to test after I work through some other enhancements.

fdevans avatar Sep 21 '24 01:09 fdevans

I think you are referencing using the import command to import an existing Rundeck job that already has these flags? If that is the case, I tried that, the tfstate does not contain those 4 flags.

I'm working on adding them in a PR.

b0tting avatar Sep 25 '24 14:09 b0tting

This was merged by @fdevans in #140

b0tting avatar Oct 01 '24 11:10 b0tting