Forms
Forms are added as YAML files in the forms folder. Each YAML file can contain a single form or a list of forms. Subfolders are supported if you want to organize your forms.
Forms Loading
AnsibleForms loads forms from the following locations:
- FROM REPOSITORIES : All repositories with “use for forms” switch enabled (supports multiple repositories)
- Forms are automatically merged from all enabled repositories
- First checks for a
forms/subfolder in each repository - Falls back to repository root if
forms/subfolder doesn’t exist
- FROM LOCAL FOLDER : The local
forms/folder (FORMS_FOLDER_PATH environment variable) if no repositories are configured
Note: You can enable “use for forms” on multiple repositories and all forms will be merged together. Make sure form names are unique across repositories to avoid conflicts.
Form Object
Each form in the forms list is configured with the below attributes.
| Attribute | Comments |
|---|---|
| basic | |
|
name string / required / unique |
The name of the form The name of a form is also the identifier of the form and thus must be unique. For simplicity we have chosen not to some sore of guid as unique identifier. This does mean, however, that when your rename a form any reference to it will be broken. |
|
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 `public` role. **Note** : An admin has always access. 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 |
|
description string |
Form description A short description, explaining what the form does. |
|
help string |
Help Using markdown you can a more detailed help message to help the operator understand the form. Examples: 1) blockquote with title, list, italic and bold |
|
type string |
Form type Our form eventually sends extravars to a target. That target can be an ansible-playbook, an awx-template or a multistep (which is a list or combination of multiple playbooks/templates, executed sequentially).
Choices:
Examples: 1) Run AWX Template Create VM 2) Run Delete VM playbook 3) Run multistep job |
|
template string |
Awx template This attribute is only used when the form type is `awx`. When using native Ansible, use the property `playbook`. **Note** : You can also dynamically set the template by using a field called `__template__`. It must be sent as extravar. If this extravar is found it will overwrite the static template name. **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step.
Only available with types:
awx Examples: 1) Run AWX Template Helloworld 2) Use dynamic template name |
|
playbook string |
Ansible playbook This attribute is only used when the form type is `ansible`. When using awx, use the property `template`. **Note** : You can also dynamically set the playbook by using a field called `__playbook__`. It must be sent as extravar. If this extravar is found it will overwrite the static playbook name. **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step.
Only available with types:
ansible Examples: 1) Run foobar playbook 2) Use dynamic playbook 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 `asCredentials`. From now on, you can also define them statically in the form. Additionally, you can also set these dynamically by using the a field name __credentials__. **Note** : that this also works in steps, so each step can have its own set of credentials. **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. **Note** : The credential can be a regex **Note** : A second, fallback, credential kan be passed using a comma Examples: 1) Send vmware and microsoft credentials 2) Dynamically send credentials |
|
ansibleCredentials string added in version 4.0.17 |
Pass ansible_user and ansible_password to ansible playbook using stored credentials Ansible allows to pass default ansible credentials in the form of 2 extravars ansible_user and ansible_password |
|
playbookSubPath string added in version 6.0.1 |
Subfolder structure for playbooks If you have a more complex ansible setup, you might want to organize them in subfolders. Use this property to define a subfolder (or multiple levels) where you want to launch ansible-playbook from. |
|
vaultCredentials string added in version 5.0.2 |
Pass vault password to ansible playbook using stored credentials Ansible can encrypt variables in a vault, to unlock the vault a password is needed. This password can be stored in Ansible Forms (as credential) and passed to the playbook.. |
|
steps array |
Multistep steps A multistep form is basically an array of multiple form type destinations, defined here as steps.
Only available with types:
multistep |
|
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:** - Absolute paths: used as-is (e.g., `/opt/shared/vars/database.yaml`) - Relative paths: resolved against VARS_FILES_PATH environment variable (default: `persistent/vars/`) **Use Cases:** - Share common variables across multiple forms - Separate sensitive configuration from form definitions - Centralize environment-specific settings **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 |
|
fields array |
fields It makes sense that a form has 1 or more formfields. Read more about them in the separate formfield section. Examples: 1) Examples |
| interaction | |
|
approval object |
Add approval point Ansible Forms allows to add an approval point before a job is ran. An approval link is sent by email to a specific approver who can then approve or reject the job. |
|
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. * **onSubmit** : Triggered the moment the submit button is pressed * **onSuccess** : Triggered when the job is finished succesfully * **onFailure** : Triggered when the job was not succesful * **onAbort** : Triggered when the job was aborted * **onFinish** : Triggered when the job is finished, regardless the status 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. * **onSubmit** : Triggered the moment the submit button is pressed * **onSuccess** : Triggered when the job is finished succesfully * **onFailure** : Triggered when the job was not succesful * **onAbort** : Triggered when the job was aborted * **onFinish** : Triggered when the job is finished, regardless the status 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. * **onSubmit** : Triggered the moment the submit button is pressed * **onSuccess** : Triggered when the job is finished succesfully * **onFailure** : Triggered when the job was not succesful * **onAbort** : Triggered when the job was aborted * **onFinish** : Triggered when the job is finished, regardless the status 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. * **onSubmit** : Triggered the moment the submit button is pressed * **onSuccess** : Triggered when the job is finished succesfully * **onFailure** : Triggered when the job was not succesful * **onAbort** : Triggered when the job was aborted * **onFinish** : Triggered when the job is finished, regardless the status 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. * **onSubmit** : Triggered the moment the submit button is pressed * **onSuccess** : Triggered when the job is finished succesfully * **onFailure** : Triggered when the job was not succesful * **onAbort** : Triggered when the job was aborted * **onFinish** : Triggered when the job is finished, regardless the status Follow the link above to learn about the possible job status actions Examples: 1) Examples |
| visualization | |
|
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](https://www.fontawesome.com). **Note** : You can either have an icon or an image, not both. Examples: 1) Trash icon |
|
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. To do this, find a not-to-large PNG image or better, an SVG image and convert to a base64 image url. You can do this [here](https://base64.guru/converter/encode/image). **Note** : You can either have an icon or an image, not both. Examples: 1) Microsoft image 2) Internet image 3) Local image |
|
tileClass string |
Form tile background colour Ansible Forms uses the Bulma css framework to style the webapplication. Bulma has a few color helper classes you can use to give your formtile a background color. You can find them here [background color](https://bulma.io/documentation/helpers/color-helpers/#background-color) and [foreground color](https://bulma.io/documentation/helpers/color-helpers/#text-color). **Hint**: Try to add a matching foreground color.
Default:
has-background-light Examples: 1) warning color 2) success light color |
|
fieldGroupClasses object |
Fieldgroup background color Ansible Forms uses the Bulma css framework to style the webapplication. Bulma has a few color helper classes you can use to give your fieldgroups a background color. You can find them here [background color](https://bulma.io/documentation/helpers/color-helpers/#background-color) and [foreground color](https://bulma.io/documentation/helpers/color-helpers/#text-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 | |
|
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 `__inventory__`. It must be sent as extravar. If this extravar is found it will overwrite the static inventory. **Note** : Ansible core allows multiple inventories (so you can use an array), however awx does not support multiple inventories. **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. |
|
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 `__executionEnvironment__`. It must be sent as extravar. If this extravar is found it will overwrite the static executionEnvironment. **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. |
|
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. It can be a single string (name of instancegroup) or an array (list of names). **Note** : You can also dynamically set the instanceGroups by using a field called `__instanceGroups__`. It must be sent as extravar. If this extravar is found it will overwrite the static instanceGroups. **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. |
|
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 `__scmBranch__`. It must be sent as extravar. If this extravar is found it will overwrite the static scmBranch. **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. |
|
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 `__awx__`. It must be sent as extravar. If this extravar is found it will overwrite the static awx. **Note** : this also works in steps, so each step can have its own set of awx instances. **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. 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. From now on, you can also add credentials from Ansible Forms. **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. **Note** : this also works in steps, so each step can have its own set of awxCredentials. **Note** : the credentials will be added on top of the ones already selected in the template, they will be merged. **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. 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 `__check__`. It must be sent as extravar. If this extravar is found it will overwrite the static check field. The field must result in a boolean (expression or checkbox) **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. |
|
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 `__limit__`. It must be sent as extravar. If this extravar is found it will overwrite the static check field. The field must result in number (number field or expression) **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. |
|
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 `__diff__`. It must be sent as extravar. If this extravar is found it will overwrite the static diff field. The field must result in a boolean (expression or checkbox) **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. |
|
verbose boolean added in version 4.0.0 |
Run in verbose mode In ansible core you run a playbook in verbose mode. Enable this attribute to do so. **Note** : You can also dynamically set the verbose mode by using a field called `__verbose__`. It must be sent as extravar. If this extravar is found it will overwrite the static diff field. The field must result in a boolean (expression or checkbox) **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. |
|
keepExtravars boolean added in version 4.0.0 |
Do not remove the extarvars json file In ansible core we temporarily store the extravars in a json file. After run, this file is removed. Use this property to disable this behaviour. **Note** : You can also dynamically set this property by using a field called `__keepExtravars__`. It must be sent as extravar. If this extravar is found it will overwrite the static diff field. The field must result in a boolean (expression or checkbox) **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. |
|
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 `__tags__`. It must be sent as extravar. If this extravar is found it will overwrite the static tags. **Note** : If you use multistep and you want to dynamically set every step, use the `key` property and `model` property to create separate extravars per step. |