page_title | subcategory | description |
---|---|---|
morpheus_shell_script_task Resource - terraform-provider-morpheus |
Provides a Morpheus shell script task resource |
Provides a Morpheus shell script task resource
Creating the shell script task with local script content:
resource "morpheus_shell_script_task" "tfexample_shell_local" {
name = "tfexample_shell_local"
code = "tfexample_shell_local"
labels = ["demo", "terraform"]
source_type = "local"
script_content = <<EOF
echo "testing"
EOF
sudo = true
retryable = true
retry_count = 1
retry_delay_seconds = 10
allow_custom_config = true
}
Creating the shell script task with the script fetched from a url:
resource "morpheus_shell_script_task" "tfexample_shell_url" {
name = "tfexample_shell_url"
code = "tfexample_shell_url"
labels = ["demo", "terraform"]
source_type = "url"
result_type = "json"
script_path = "https://example.com/example.sh"
sudo = true
retryable = true
retry_count = 1
retry_delay_seconds = 10
allow_custom_config = true
}
Creating the shell script task with the script fetch via git:
resource "morpheus_shell_script_task" "tfexample_shell_git" {
name = "tfexample_shell_git"
code = "tfexample_shell_git"
labels = ["demo", "terraform"]
source_type = "repository"
result_type = "json"
script_path = "example.sh"
version_ref = "master"
repository_id = 1
sudo = true
retryable = true
retry_count = 1
retry_delay_seconds = 10
allow_custom_config = true
}
name
(String) The name of the shell script tasksource_type
(String) The source of the shell script (local, url or repository)
allow_custom_config
(Boolean) Custom configuration data to pass during the execution of the shell scriptcode
(String) The code of the shell script taskexecute_target
(String) The execute target of the shell script (local, remote, resource)labels
(Set of String) The organization labels associated with the task (Only supported on Morpheus 5.5.3 or higher)local_repository_id
(String) The ID of the local git repositorylocal_repository_ref
(String) The git reference of the repository to pull (main, master, etc.)remote_target_host
(String) The hostname or ip address of the remote targetremote_target_password
(String) The password of the user account used to authenticate to the remote targetremote_target_port
(String) The port used to connect to the remote targetremote_target_username
(String) The username of the user account used to authenticate to the remote targetrepository_id
(Number) The ID of the git repository integrationresult_type
(String) The expected result type (value, keyValue, json)retry_count
(Number) The number of times to retry the task if there is a failureretry_delay_seconds
(Number) The number of seconds to wait between retry attemptsretryable
(Boolean) Whether to retry the task if there is a failurescript_content
(String) The content of the shell script. Used when the local source type is specifiedscript_path
(String) The path of the shell script, either the url or the path in the repositorysudo
(Boolean) Whether to run the script as sudoversion_ref
(String) The git reference of the repository to pull (main, master, etc.)visibility
(String) The visibility of the task (private or public)
id
(String) The ID of the shell script task
Import is supported using the following syntax:
terraform import morpheus_shell_script_task.tf_example_shell_task_script 1