This ansible project is intended to be a toolkit for operators of Itential Automation Platform and Itential Automation Gateway. It includes Itential's recommended methods for performing administration tasks, making adminstrative changes to the platforms, and interrogating dependent systems for runtime information.
Playbooks in this collection need to connect to some combination of:
- Host Machines (via SSH), or
- The Itential Platform Service (via API).
- The IAG Service (via API).
To connect to the instances using Ansible:
ansible_user: The SSH username.- One of the following authentication methods:
ansible_password: SSH password (can be prompted with--ask-pass).ansible_ssh_private_key_file: Path to SSH private key (can be passed with--private-key).
To connect to the Itential Platform API, provide
platform_port: The port that platform is accessible onplatform_https: Boolean that describes HTTPS (true) or HTTP (false) for the Platform API.- Either:
platform_usernameandplatform_password, orplatform_auth_token.
To connect to the IAG API, provide
iag_port: The port that IAG is accessible oniag_https: Boolean that describes HTTPS (true) or HTTP (false) for the IAG API.- Either:
iag_usernameandiag_password, oriag_auth_token.
Variables can be:
- Defined in an inventory file (hosts file).
- Passed via the command line using
--extra-varsor-e.
Example:
ansible-playbook playbook.yml -i hosts.yaml --extra-vars 'platform_auth_token=<token>'
- Get Platform Token
- Restart Adapter
- Metrics
- Adjusting Adapters' log level
- Starting/Stopping Workersics
- Mongo Dump
- Create Adapter
- App Adapter Version
- Sync IAG Custom Script Schema
- Dependencies Version
- Switch Active Profile
- Job and Task Worker Status
- RBAC Settings
- IAG Refresh Custom Script
- Restart Platform
- Restart IAG
- Admin All Roles
This tool will fetch a platform session token and display it to the screen. This playbook requries Platform API access.
ansible-playbook playbooks/get_platform_token.yml -i hosts.yaml --extra-vars 'platform_username=<some-user> platform_password=<some-password>'
This tool will restart a list of provided adapter names after fetching an IAP session token. This playbook requries Platform API access.
| NAME | DESCRIPTION |
|---|---|
| adapters | String(one adapter) or Comma separated list of adapter names to restart |
ansible-playbook playbooks/restart_adapters.yml -i hosts.yaml --extra-vars 'iap_username=<some-user> iap_password=<some-password> adapters=<comma-separated-list-of-adapter-names>'
This tool will show the quantity of workflows, templates, MOP templates, analytic templates, JSTs, JSON forms, forms, jobs and automations in IAP. This playbook requries Platform API access.
ansible-playbook playbooks/metrics.yml -i hosts.yaml --extra-vars 'iap_username=<some-user> iap_password=<some-password>'
This tool will adjust the log level of the adapters in IAP. Available options are
error, warn, info, debug, trace, spam. This playbook requries Platform API access.
| NAME | DESCRIPTION |
|---|---|
| log_level | The log level to be set (error, warn, info, debug, trace, spam) |
ansible-playbook playbooks/adapters_log_level.yml -i hosts.yaml --extra-vars 'iap_username=<some-user> iap_password=<some-password> log_level=error'
These playbooks will start or stop task workers and/or job workers (supported in Platform 2023.1 and later). These playbooks requrie Platform API access.
Each action has its own playbook:
start_task_worker.ymlstop_task_worker.ymlstart_job_worker.ymlstop_job_worker.yml
ansible-playbook start_task_worker.yml -i hosts.yaml --extra-vars 'platform_username=<user> platform_password=<password>'
This tool will dump single or all collections from a given mongo database. This playbook requries Host Machine access.
| NAME | DESCRIPTION |
|---|---|
| db | The database containing collections to be dumped |
| mongo_auth_db | The database to perform authentication on |
| mongo_username | MongoDB username |
| mongo_password | MongoDB user's password |
| collection | Optional. If not defined, all collections in the database will be dumped |
ansible-playbook playbooks/mongo_dump.yml -i hosts.yaml --extra-vars 'db=itential collection=workflows'
This tool will create the adapter and starts it. This playbook requries Platform API access.
| NAME | DESCRIPTION |
|---|---|
| adapter_properties_file | Name of the JSON file where the adapter properties are stored. |
ansible-playbook playbooks/create_adapter.yml -i hosts --extra-vars 'adapter_properties_file="<file_path>" iap_username=<some-user> iap_password=<some-password>'
This tool will show the the version of applications and adapters in the IAP. User can specify the applications/adapters of which they want to see the version. The users also have the option to view the versions of all applications and adapters. This playbook requries Platform API access.
| NAME | DESCRIPTION |
|---|---|
| adapter_app_names | Names of applications and adapters, separated by comma. If no names are provided, will return versions of all applications and adapters. |
The following command returns the version of local_aaa adapter and AGManager application:
ansible-playbook playbooks/app_adapter_version.yml -i hosts --extra-vars 'adapter_app_names="local_aaa, AGManager" iap_username=<some-username> iap_password=<some-password>'
The following command returns the version of all applications and adapters.
ansible-playbook playbooks/app_adapter_version.yml -i hosts --extra-vars 'adapter_app_names="" iap_username=<some-username> iap_password=<some-password>'
This tool will grab the JSON schema(decorations) of the custom script from the first IAG host in the gateway group and applies it to the custom script across other IAG hosts in the gateway group.
This playbook requries IAG API access.
| NAME | DESCRIPTION |
|---|---|
| script_name | Name of the custom script |
NOTE: Make sure that the first host in the
gatewaygroup has the latest JSON schema.
ansible-playbook sync_iag_script_schema.yml -i hosts --extra-vars 'script_name=hello.py'
This tool will return the version of redis, rabbitmq, mongobd, IAP components, and IAG components. More information about the dependencies can be found in this page. The rabbitmq server, redis server, IAP server and IAG server should be under their respective group in the hosts file. This playbook requries Host Machine access.
| NAME | DESCRIPTION |
|---|---|
| component | The component(mongodb, redis, etc) to target to. Available options are: |
mongodb : Returns the version of mongodb |
|
redis : Returns the version of redis |
|
rabbitmq : Returns the version of rabbitmq |
|
platform : Returns the version of mongodb, redis, rabbitmq, and IAP dependencies |
|
gateway : Returns the version of IAG dependencies. |
|
all : Returns the version across all five components. |
ansible-playbook playbooks/dependencies_version.yml -i hosts --extra-vars 'component=all'
This tool will switch the active profile to the profile specified. After the active profile is switched, it restarts the IAP. This playbook requries Host Machine and Platform API access.
| NAME | DESCRIPTION |
|---|---|
| id | The id of the profile. |
ansible-playbook playbooks/app_adapter_version.yml -i hosts --extra-vars 'id=<profile-id> iap_username=<some-username> iap_password=<some-password>'
Running the playbook by providing ssh key file from command line
ansible-playbook playbooks/app_adapter_version.yml -i hosts --extra-vars 'id=<profile-id> iap_username=<some-username> iap_password=<some-password>' --private-key <key_file_name>
Running the playbook by providing ssh username and password from command line
ansible-playbook playbooks/app_adapter_version.yml -i hosts --extra-vars 'id=<profile-id> iap_username=<some-username> iap_password=<some-password>' -u <ssh_username> --ask-pass <password>
This tool will return the status of job worker and task worker of IAP. This playbook requries Platform API access.
| NAME | DESCRIPTION |
|---|---|
| iap_port | The port that the IAP is running on. |
| iap_protocol | The HTTP/HTTPS protocol that is being used by IAP |
| iap_username | The application user's name |
| iap_password | The application user's password |
ansible-playbook playbooks/job_worker_status.yml -i hosts --extra-vars 'iap_username=<some-username> iap_password=<some-password>
This playbook retrieves RBAC (Role-Based Access Control) settings for one or more users in the Platform. It gathers authorization accounts and roles from the Platform API, processes the data, and displays the assigned roles for the specified users. This playbook requries Platform API access.
| NAME | DESCRIPTION |
|---|---|
| users | A single username (string) or a list of usernames. |
Get RBAC settings for multiple users using username/password:
ansible-playbook rbac_settings.yml -i hosts.yaml --extra-vars 'platform_username=<user> platform_password=<password> users=["user1","user2"]'
This tool will refresh the custom scripts cache in IAG. Furthermore, it also restarts the AGManager application and the IAG adapters in the IAP so that the updated scripts can be accessed from the IAP. The IAP hostnames should be under platform group and the IAG hostnames should be under the gateway group inside the host file.
This playbook requries Platform API and IAG API access.
ansible-playbook playbooks/iag_refresh_custom_scripts.yml -i hosts --extra-vars 'iap_username=<some-username> iap_password=<some-password> iag_username=<some-username> iag_password=<some-password>'
This tool will perform a safe restart the Itential Platform. It turns off task and job workers then waits until there are no in progress jobs before restarting the Platform. The playbook requires Host Machine and Platform API access.
Running playbook when password/key file is defined in the hosts file
ansible-playbook playbooks/restart_iap.yml -i hosts
This tool will restart the IAG. This playbook requries Host Machine access.
Running playbook when password/key file is defined in the hosts file
ansible-playbook playbooks/restart_iag.yml -i hosts
Running playbook by providing key file from command-line
ansible-playbook playbooks/restart_iag.yml -i hosts --private-key <key_file_name>
Running playbook by providing username and password from command-line
ansible-playbook playbooks/restart_iag.yml -i hosts -u <ssh_username> --ask-pass <password>
This tool will add all available roles to the admin user. This playbook requries Platform API access.
ansible-playbook playbooks/admin_all_roles.yml -i hosts.yaml --extra-vars 'iap_username=<some-user>' --vault-password-file .password