Skip to content

Commit

Permalink
Merge pull request #114 from dbrowneihg/hidden_option
Browse files Browse the repository at this point in the history
Add hidden to job option attributes
  • Loading branch information
fdevans authored Oct 30, 2023
2 parents df2ac9e + db3c867 commit 9c3083a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rundeck/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ type JobOption struct {

// Description of the value to be shown in the Rundeck UI.
Description string `xml:"description,omitempty"`

// Option should be hidden from job run page
Hidden bool `xml:"hidden,omitempty"`
}

// JobValueChoices is a specialization of []string representing a sequence of predefined values
Expand Down
6 changes: 6 additions & 0 deletions rundeck/resource_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ func resourceRundeckJob() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"hidden": {
Type: schema.TypeBool,
Optional: true,
},
},
},
},
Expand Down Expand Up @@ -686,6 +690,7 @@ func jobFromResourceData(d *schema.ResourceData) (*JobDetail, error) {
ObscureInput: optionMap["obscure_input"].(bool),
ValueIsExposedToScripts: optionMap["exposed_to_scripts"].(bool),
StoragePath: optionMap["storage_path"].(string),
Hidden: optionMap["hidden"].(bool),
}
if option.StoragePath != "" && option.ObscureInput == false {
return nil, fmt.Errorf("Argument \"obscure_input\" must be set to `true` when \"storage_path\" is not empty.")
Expand Down Expand Up @@ -924,6 +929,7 @@ func jobToResourceData(job *JobDetail, d *schema.ResourceData) error {
"obscure_input": option.ObscureInput,
"exposed_to_scripts": option.ValueIsExposedToScripts,
"storage_path": option.StoragePath,
"hidden": option.Hidden,
}
optionConfigsI = append(optionConfigsI, optionConfigI)
}
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/job.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ The following arguments are supported:
`true` when using this. This results in `Secure Remote Authentication` input type. Setting `exposed_to_scripts` also
`true` results in `Secure` input type.

* `hidden`: (Optional) Boolean controlling whether this option should be hidden from the UI on the job run page.
Defaults to `false`.

`command` blocks must have any one of the following combinations of arguments as contents:

* `description`: (Optional) gives a description to the command block.
Expand Down

0 comments on commit 9c3083a

Please sign in to comment.