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

Hidden option #115

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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