run ansible-playbook
  • 29 Oct 2024
  • Dark
    Light
  • PDF

run ansible-playbook

  • Dark
    Light
  • PDF

Article summary

iagctl run ansible-playbook

Execute an Ansible playbook service

Synopsis

This command will execute an Ansible playbook service and display the resulting stdout, stderr, return code, as well as some additional execution time information.

Runtime variables called extra-vars by Ansible can be specified using the --set flag. The --set flag takes in a key=value syntax. Any variables passed in using --set will be validated against the decorator if one was defined during service creation.

To view helpful information about what inputs are accepted by a particular service, run this command with the service name and the --use flag.

iagctl run ansible-playbook <service-name> [flags]

Examples

Playbook Service

Run a simple Ansible playbook service called my-ansible-service.

iagctl run ansible-playbook my-ansible-service

Setting Arguments

Run an Ansible playbook service called my-ansible-service that takes in an extra-vars input of interface

iagctl run ansible-playbook my-ansible-service \
--set interface=0/0/0

Options

-h, --help              Help for ansible-playbook
--set stringArray       Sets an input argument to be passed into the script via CLI when executed. Arguments are sent in the order in which they are defined and are appended to the arguments already defined on the ansible playbook service. They must follow the key=value syntax and the service must support the inputs.
--use                   Display usage of the plan.

Options Inherited from Parent Commands

--config string   Path to the configuration file
--raw             Displays the result of the command in its raw format
--verbose         Enable verbose output

CLI References

See related run commands:

For all CLI commands see → Command References Index


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.