AWX Forms
AWX forms execute an AWX / Ansible Tower job template when submitted.
Targets an Awx Template.
The AWX Connection token must be set in the settings.
Awx Form
- name: Delete a vm
roles: # reference to roles defined earlier
- vmware
description: Delete a virtual machine
help: This Form deletes a virtual machine.
showHelp: true # show help on load
image: https://picsum.photos/64 # an image url (can be base64)
categories: # reference to categories defined earlier
- Demo
- Vmware
- Decommissioning/Linux # Add to a subcategory using the `/` separator
tileClass: bg-danger # a bootstrap background color style (https://getbootstrap.com/)
template: remove_vm # template to launch (only if type = awx)
inventory: inventory # optional awx inventory
check: false # run in checkmode or not
diff: false # show differences
tags: vm,delete # optional ansible tags (comma separated)
type: awx # type is awx or ansible
onSubmit: # event handler on form submit
- clear: 0 # clear form after 0 seconds
- hide: 1 # hide form after 1 second
onSuccess: # event handler on form success
- load: 1,Another Form # load another form after 1 second
onFailure: # event handler on job failure
- show: 2 # show the form after 2 seconds
onAbort: # event handler on job failure
- reload: 3 # reload the form after 3 seconds
fieldGroupClasses: # give fieldgroups a custom background
groupname1: bg-info-subtle
groupname2: bg-success-subtle
fields: # list of field objects Properties
Properties specific to type: awx, in addition to the common form properties.
Basic
| Attribute | Comments |
|---|---|
| roles array / required | Who has access You can have RBAC by adding roles to a form. If you want everyone to see the form, add the Examples: 1) Give access to vmware team |
| categories array | Categories By adding one or more categories, you can group forms together in categories. Examples: 1) Category vmware |
| template string | Awx template This attribute is only used when the form type is Note : You can also dynamically set the template by using a field called Examples: 1) Run AWX Template Helloworld 2) Use dynamic template name |
| credentials object added in version 4.0.16 | Send credentials to your playbook/template From the earlier versions, you could send credentials, stored in Ansible Forms, by using the field-property Examples: 1) Send vmware and microsoft credentials 2) Dynamically send credentials |
| varsFiles array added in version 6.1.0 | Load YAML files as constants Load one or more YAML files as constants that will be merged with the base config constants. Files must contain a dictionary (not a list) and must have .yml or .yaml extension. Path Resolution:
Use Cases:
Note: Files are merged in order. Later files override earlier ones if keys conflict. Variables from varsFiles are merged with base config constants. Examples: 1) Load single vars file 2) Load multiple vars files with absolute paths 3) Mix relative and absolute paths |
Interaction
| Attribute | Comments |
|---|---|
| approval object | Add approval point Ansible Forms allows to add an approval point before a job is ran. |
| notifications object | Add Notification Add email notifications on job status events. Examples: 1) Send on success |
| onSubmit array added in version 3.1.0 | Events on submit Once a job is launched, Ansible Forms has a few status events you can act on.
Follow the link above to learn about the possible job status actions Examples: 1) Examples |
| onSuccess array added in version 3.1.0 | Events on success Once a job is launched, Ansible Forms has a few status events you can act on.
Follow the link above to learn about the possible job status actions Examples: 1) Examples |
| onFailure array added in version 3.1.0 | Events on failure Once a job is launched, Ansible Forms has a few status events you can act on.
Follow the link above to learn about the possible job status actions Examples: 1) Examples |
| onAbort array added in version 3.1.0 | Events on abort Once a job is launched, Ansible Forms has a few status events you can act on.
Follow the link above to learn about the possible job status actions Examples: 1) Examples |
| onFinish array added in version 3.1.0 | Events on finished Once a job is launched, Ansible Forms has a few status events you can act on.
Follow the link above to learn about the possible job status actions Examples: 1) Examples |
Visualization
| Attribute | Comments |
|---|---|
| showHelp boolean | Show Help Show the help by default or collapse the help. Default: true |
| icon string | Form icon You can add a nice icon to your forms. The icon name is a free fontawesome 6 icon. You can find more information at www.fontawesome.com. Examples: 1) Trash icon |
| iconColor string | Icon color Specifies the color of the icon. Use any valid CSS color class name (e.g., primary, success, danger, warning, info, dark, white, …). Examples: 1) Red icon |
| iconSize string | Icon size Specifies the size of the icon. Default: 3x Examples: 1) Large icon |
| overlayIcon string | Overlay icon on main icon Adds a icon on top of the main icon for layering effects. Useful for status indicators or badges. Examples: 1) Server with check overlay |
| overlayIconTransform string | Transform for overlay icon Specifies the transform/positioning for the overlay icon. You can use FontAwesome transform values like shrink, grow, up, down, left, right. Default: shrink-6 up-7 right-7 Examples: 1) Custom positioned overlay |
| overlayIconColor string | Color for overlay icon Specifies the color of the overlay icon. Default: success Examples: 1) Red overlay icon |
| overlayIconCircle boolean | Show circle background behind overlay icon When enabled, shows a colored circle background behind the overlay icon. The circle uses the overlayIconColor, and the icon inside becomes white in light mode or dark in dark mode. When disabled, the overlay icon appears without a circle background. Default: true Examples: 1) Overlay without circle |
| overlayIconText string | Text overlay on icon Adds text as an overlay on the icon. Can be used for badges, counters, or labels. Examples: 1) New badge |
| overlayIconTextPosition string | Position for text overlay Specifies the position of the text overlay. Default: bottom-left Examples: 1) Top right badge |
| overlayIconTextColor string | Color for text overlay Specifies the color of the text overlay. Default: success Examples: 1) Warning badge |
| image string | Form image You can add a nice image to your form. You can provide a local or remote url. But if you are in a secured location, you might want to go for a base64 encode image. This allows you to embed the image in the yaml file. Examples: 1) Microsoft image 2) Internet image 3) Local image |
| tileClass string | Form tile background colour Ansible Forms uses the Bootstrap css framework to style the webapplication. Default: bg-info-subtle Examples: 1) warning color 2) success light color |
| fieldGroupClasses object | Fieldgroup background color Ansible Forms uses the Bootstrap css framework to style the webapplication. Bootstrap has a few color helper classes you can use to give your fieldgroups a background color. You can find them here background color and foreground color. Examples: 1) Color fieldgroup |
| order integer added in version 5.1.0 | Order of the form in the list The order of the form in the list of forms. Forms are sorted by this order, so you can have a specific order in the list. Note : If you do not set this property, it will be ordered alphabetically by name. |
Workflow
| Attribute | Comments |
|---|---|
| inventory string | Inventory In both awx and ansible core you can pass an inventory. In the case of ansible core, it will be a yaml file. In case of awx it will be the inventory name. Note : You can also dynamically set the inventory by using a field called |
| executionEnvironment string added in version 5.0.0 | Execution Environment In newer versions of AWX you can choose an execution environment. Use this property to pass it to your template. Note : You can also dynamically set the executionEnvironment by using a field called |
| instanceGroups array or string added in version 5.0.0 | Instance Groups In newer versions of AWX you can choose instance groups. Use this property to pass it to your template. Note : You can also dynamically set the instanceGroups by using a field called |
| scmBranch string added in version 5.0.0 | SCM Branch Awx allows to pass the scm branch. Use this property to pass it to your template. Note : You can also dynamically set the scmBranch by using a field called |
| awx string added in version 6.0.0 | Add awx instance to your template From now on you can have multiple AWX instances. The database will be updated during upgrade but you will need to set your current AWX instance to default. Note : you can also set these dynamically by using a field called Examples: 1) Add awx instance to your template |
| awxCredentials array added in version 4.0.16 | Add awx credentials to your template In AWX you can set credentials on your template. Note : you can also set these dynamically by using the a field name awxCredentials. It must be sent as extravar. If this extravar is found it will overwrite the static awxCredentials. Examples: 1) Add awx credentials to your template 2) Dynamically send credentials |
| check boolean | Run in check mode In both awx and ansible core you run a playbook in check mode. Enable this attribute to do so. Note : You can also dynamically set the check mode by using a field called |
| limit text | Run against a limited number of hosts In awx and ansible core you run a playbook against limited hosts by supplying a host pattern. Use this attribute to do so. Note : You can also dynamically set the limit by using a field called |
| diff boolean | Run in diff mode In both awx and ansible core you run a playbook in diff mode. Enable this attribute to do so. Note : You can also dynamically set the check mode by using a field called |
| abortable boolean added in version 5.0.8 | Allow aborting the job By default you can allow the user to abort the job. Use this attribute to disable this behaviour. Default: true |
| string | Set tags In both awx and ansible core you can pass tags. Use this attribute to pass a comma separted list of tags. Note : You can also dynamically set the tags by using a field called |