iagctl create executable-object

Create a new executable object resource.

Use this command to create an executable object resource in the gateway’s data store. An executable object references an executable file on the machine where the gateway runs services.

For more information, see Executable objects.

You can pair an executable object with a service to control how the service runs. The executable object overrides the following behavior for each service type:

  • Python — Path to the Python interpreter on disk
  • Ansible — Path to the Python interpreter that Ansible runs under on disk
  • OpenTofu — Path to the OpenTofu executable on disk
  • Executable — Path to any executable file, for example /bin/bash

Syntax

iagctl create executable-object <name> [flags]

Usage pattern

The following example shows how to use an executable object with a Python service.

1

Create an executable object

To use a specific Python interpreter when executing a Python service, create an executable object that points to it. For example, if you want to use /usr/bin/python3.12 instead of the interpreter in your $PATH at /usr/bin/python3.9, run the following:

$iagctl create executable-object py-312 \
> --exec-command /usr/bin/python3.12
2

Create a service that references the executable object

Reference the executable object when creating a Python, Ansible, OpenTofu, or executable service using the --executable-object flag:

$iagctl create service python-script my-script \
> --executable-object py-312 \
> --repository my-repo
3

Run the service

Run the service and confirm that the specified executable is being used by checking the DEBUG level logs:

$iagctl run service python-script my-script --verbose
$...
$DBG validating that executable exists at '/usr/bin/python3.12'
$DBG running command '/usr/bin/python3.12 --version'

Examples

Create an executable object linking to bash

Creates an executable object for use with the executable service. See iagctl create service executable --help for more information.

$iagctl create executable-object bash \
> --exec-command /bin/bash

Create an executable object linking to a Python interpreter

Creates an executable object that links to a specific Python interpreter for use with Python and Ansible services.

$iagctl create executable-object py312 \
> --exec-command /usr/bin/python3.12

Options

--description string A brief description of the service
--exec-command string The command to be used to execute the resource. Typically the path to an
executable on the gateway execution instance
-h, --help help for executable-object
--tag stringArray Metadata tag(s) to associate with the service

Options inherited from parent commands

--config string Specify the path to the configuration file
--profile string Specify the client profile to use (case-insensitive, defaults to [client] section)
--raw Displays the result of the command in its raw format
--verbose Enable verbose output