An executable service is a service type that runs scripts or applications using a pre-defined executable object. Executable services provide flexibility to run any type of script or tool, including Bash scripts, Terraform configurations, or custom applications.
What executable services do
Executable services allow you to:
- Run Bash scripts stored in a Git repository
- Execute infrastructure automation tools like Terraform
- Run custom scripts and applications
- Use different execution environments for different services
- Reference pre-configured executable objects without knowing system paths
How executable services differ from other service types
IAG supports several service types. Each service type is designed for specific use cases:
- Python services: Run Python scripts with a specific Python interpreter
- Ansible services: Execute Ansible playbooks
- OpenTofu services: Run OpenTofu configurations
- Executable services: Run any script or application using a custom executable object
Executable services provide the most flexibility because you define the execution command through the executable object, rather than using a predefined service type.
Prerequisites
- An executable object that defines the command to run your script
- Operator role permissions
Optional:
- A Git repository that contains your script or application (if your script is stored in a repository)
- Repository authentication configured (if using a private repository)
How executable services work
Executable services use the following components:
- Executable object: Defines the command that runs your script (for example,
/usr/bin/bashor/usr/local/bin/terraform) - Repository: Contains the script or application files
- Working directory: Specifies the path within the repository where your script is located
- Filename: Identifies the specific script to execute
- Argument format (optional): Defines how to pass arguments to your script at runtime
When you run an executable service, IAG:
- Pulls the latest version of your repository
- Navigates to the working directory
- Executes the specified file using the executable object's command
- Passes any runtime arguments according to the argument format
Argument formatting
Executable services support flexible argument passing through the --arg-format parameter. This parameter uses template variables to define how IAG passes arguments to your script.
Template variables:
{{.Key}}: The argument name{{.Value}}: The argument value
Common argument formats:
Format 1: Space-separated key-value pairs
--arg-format "{{.Key}} {{.Value}}"
This format passes arguments as: --environment production
Format 2: Equals-separated key-value pairs
--arg-format "{{.Key}}={{.Value}}"
This format passes arguments as: --environment=production