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

Reference jobs resources are missing flags #127

Closed
b0tting opened this issue Jun 7, 2024 · 3 comments
Closed

Reference jobs resources are missing flags #127

b0tting opened this issue Jun 7, 2024 · 3 comments

Comments

@b0tting
Copy link

b0tting commented Jun 7, 2024

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

@fdevans
Copy link
Contributor

fdevans commented Sep 21, 2024

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.

@b0tting
Copy link
Author

b0tting commented Sep 25, 2024

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
Copy link
Author

b0tting commented Oct 1, 2024

This was merged by @fdevans in #140

@b0tting b0tting closed this as completed Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants