Skip to content

Commit

Permalink
Merge pull request #124 from zkrapavickas/scripturl
Browse files Browse the repository at this point in the history
Add script_url param to Command.

Merging to a local branch for testing and potential merge for 0.4.8
  • Loading branch information
fdevans authored Sep 20, 2024
2 parents d42863b + d3444df commit ce4d923
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rundeck/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ type JobCommand struct {
// a shell script it should have an appropriate #! line.
Script string `xml:"script,omitempty"`

ScriptUrl string `xml:"scripturl,omitempty"`

// A pre-existing file (on the target nodes) that will be executed.
ScriptFile string `xml:"scriptfile,omitempty"`

Expand Down
12 changes: 12 additions & 0 deletions rundeck/resource_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ func resourceRundeckJobCommand() *schema.Resource {
Optional: true,
},

"script_url": {
Type: schema.TypeString,
Optional: true,
},

"script_file": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -419,6 +424,11 @@ func resourceRundeckJobCommandErrorHandler() *schema.Resource {
Optional: true,
},

"script_url": {
Type: schema.TypeString,
Optional: true,
},

"script_file": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -1149,6 +1159,7 @@ func commandFromResourceData(commandI interface{}) (*JobCommand, error) {
Description: commandMap["description"].(string),
ShellCommand: commandMap["shell_command"].(string),
Script: commandMap["inline_script"].(string),
ScriptUrl: commandMap["script_url"].(string),
ScriptFile: commandMap["script_file"].(string),
ScriptFileArgs: commandMap["script_file_args"].(string),
KeepGoingOnSuccess: commandMap["keep_going_on_success"].(bool),
Expand Down Expand Up @@ -1253,6 +1264,7 @@ func commandToResourceData(command *JobCommand) (map[string]interface{}, error)
"description": command.Description,
"shell_command": command.ShellCommand,
"inline_script": command.Script,
"script_url": command.ScriptUrl,
"script_file": command.ScriptFile,
"script_file_args": command.ScriptFileArgs,
"keep_going_on_success": command.KeepGoingOnSuccess,
Expand Down

0 comments on commit ce4d923

Please sign in to comment.