Formularios de Ansible
Formularios que ejecutan un playbook de Ansible local
Targets an Ansible playbook, run on a runner of type rte (Connections > Runners), named with runner: or the default one. Since 7 AnsibleForms runs no playbook itself.
Ansible Core Form
- name: Create a vm
roles: # reference to roles defined earlier
- vmware
description: Create a virtual machine
help: |
This Form creates a virtual machine. it will connect to `vcenter`. This help is Markdown
so you can use **markdown** markup to highlight __certain words__.
showHelp: true # show help on load
icon: computer # a font awesome icon
categories: # reference to categories defined earlier
- Demo
- Vmware/Linux # Add to a subcategory using the `/` separator
tileClass: bg-success-subtle # a bootstrap background color style (https://getbootstrap.com/)
playbook: playbook_vm.yml # playbook to launch (only if type = ansible)
inventory: inventory.yml # optional ansible inventory file
check: false # run in checkmode or not
diff: false # show differences
verbose: false # verbose output
keepExtravars: false # keep extravars json file
allowJinjaInExtravars: false # let ansible template jinja in values
tags: vm,create # optional ansible tags (comma separated)
type: ansible # 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
onFinish: # event handler on job finished
- show: 2 # show the form after 2 seconds
fieldGroupClasses: # give fieldgroups a custom background
groupname1: bg-info-subtle
groupname2: bg-success-subtle
fields: # list of field objects
- name: vm_name
type: textPropiedades
Propiedades específicas de type: ansible, además de las propiedades comunes de los formularios.
Basic
| Atributo | Comentarios |
|---|---|
| roles array / obligatorio | Who has access You can have RBAC by adding roles to a form. If you want everyone to see the form, add the Ejemplos: 1) Give access to vmware team |
| categories array | Categories By adding one or more categories, you can group forms together in categories. Ejemplos: 1) Category vmware |
| playbook string | Ansible playbook This attribute is only used when the form type is Name it by its file with its subfolders in the playbook folder ( Note: You can also dynamically set the playbook by using a field called Ejemplos: 1) Run foobar playbook 2) Use dynamic playbook name |
| credentials object añadido en la versión 4.0.16 | Send credentials to your playbook/template From the earlier versions, you could send credentials, stored in AnsibleForms, by using the field-property Ejemplos: 1) Send vmware and microsoft credentials 2) Dynamically send credentials |
| ansibleCredentials string añadido en la versión 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 añadido en la versión 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 añadido en la versión 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 AnsibleForms (as credential) and passed to the playbook.. |
| wizard array añadido en la versión 6.4.0 | Wizard steps (form-layer) Turn a form into a multi-page wizard. Ejemplos: 1) Three-step wizard 2) Wizard mapped one-to-one onto multistep (defaultModel + key) |
| varsFiles array añadido en la versión 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. Ejemplos: 1) Load single vars file 2) Load multiple vars files with absolute paths 3) Mix relative and absolute paths |
Interaction
| Atributo | Comentarios |
|---|---|
| approval object | Add approval point AnsibleForms allows to add an approval point before a job is ran. |
| notifications object | Add Notification Add notifications on job status events: by email ( Ejemplos: 1) Send on success 2) Post to Slack and Teams when it fails |
| onSubmit array añadido en la versión 3.1.0 | Events on submit Once a job is launched, AnsibleForms has a few status events you can act on.
Follow the link above to learn about the possible job status actions Ejemplos: 1) Examples |
| onSuccess array añadido en la versión 3.1.0 | Events on success Once a job is launched, AnsibleForms has a few status events you can act on.
Follow the link above to learn about the possible job status actions Ejemplos: 1) Examples |
| onFailure array añadido en la versión 3.1.0 | Events on failure Once a job is launched, AnsibleForms has a few status events you can act on.
Follow the link above to learn about the possible job status actions Ejemplos: 1) Examples |
| onAbort array añadido en la versión 3.1.0 | Events on abort Once a job is launched, AnsibleForms has a few status events you can act on.
Follow the link above to learn about the possible job status actions Ejemplos: 1) Examples |
| onFinish array añadido en la versión 3.1.0 | Events on finished Once a job is launched, AnsibleForms has a few status events you can act on.
Follow the link above to learn about the possible job status actions Ejemplos: 1) Examples |
Visualization
| Atributo | Comentarios |
|---|---|
| showHelp boolean | Show Help Show the help by default or collapse the help. Por defecto: 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. Ejemplos: 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, …). Ejemplos: 1) Red icon |
| iconSize string | Icon size Specifies the size of the icon. Por defecto: 3x Ejemplos: 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. Ejemplos: 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. Por defecto: shrink-6 up-7 right-7 Ejemplos: 1) Custom positioned overlay |
| overlayIconColor string | Color for overlay icon Specifies the color of the overlay icon. Por defecto: success Ejemplos: 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. Por defecto: true Ejemplos: 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. Ejemplos: 1) New badge |
| overlayIconTextPosition string | Position for text overlay Specifies the position of the text overlay. Por defecto: bottom-left Ejemplos: 1) Top right badge |
| overlayIconTextColor string | Color for text overlay Specifies the color of the text overlay. Por defecto: success Ejemplos: 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. Ejemplos: 1) Microsoft image 2) Internet image 3) Local image |
| tileClass string | Form tile background colour AnsibleForms uses the Bootstrap css framework to style the webapplication. Por defecto: bg-info-subtle Ejemplos: 1) warning color 2) success light color |
| fieldGroupClasses object | Fieldgroup background color AnsibleForms 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. Ejemplos: 1) Color fieldgroup |
| order integer añadido en la versión 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
| Atributo | Comentarios |
|---|---|
| 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. Ansible: the name of an inventory of the designer’s Inventories section ( Note: You can also dynamically set the inventory by using a field called Ejemplos: 1) Run against an inventory of the designer |
| runner string añadido en la versión 7.0.0 | Where the job runs The runner that runs this form’s job, of the type the form’s type asks for: rte (a runtime environment container) for A disabled runner (its Enabled switch off) fails the job, also when it is the default: there is no fallback to another runner. A role’s Semaphore: a form of type semaphore runs the Semaphore template named by Rundeck: a form of type rundeck runs the Rundeck job named by Jenkins: a form of type jenkins builds the Jenkins job named by Ejemplos: 1) Run on the vmware runtime 2) Run a template on a named AAP 3) Run a Semaphore template 4) Run a Rundeck job 5) Build a Jenkins job |
| 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 string | 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 |
| verbose boolean añadido en la versión 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 |
| keepExtravars boolean añadido en la versión 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 |
| allowJinjaInExtravars boolean añadido en la versión 7.0.1 | Let ansible template Jinja in the form's values A value that contains Jinja ( Set this to Note: You can also dynamically set this property by using a field called |
| userExtravars string | Which keys of the user go into the extravars Overrides the Leave it out and the form follows the global setting. Note: a multistep applies the form’s value to every step, including the partial extravars a step receives through |
| abortable boolean añadido en la versión 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. Por defecto: true |
| allowRelaunch boolean añadido en la versión 6.2.0 | Allow relaunching the job By default, users with the Por defecto: true Ejemplos: 1) Prevent relaunching a form |
| launchValidation string añadido en la versión 6.4.1 | Check every launch of this form on the server Checks every launch of this form on the server against its validation rules, with the same engine the browser and the MCP server use - see the Set it on a form that is launched over the REST API: with Mind the fields the server computes again: a timestamp ( The stricter of this property and A wizard form is checked step by step: every step the browser submits is resolved against its subform. See the Launch validation page of the documentation. Por defecto: the LAUNCH_VALIDATION environment variable Ejemplos: 1) A form that is launched over REST |
| enableForChat boolean añadido en la versión 6.5.0 | Offer this form in the chat assistant The chat assistant ( The assistant fills the form in with the user, through the same form engine as the browser, and never launches it: the user clicks Launch on the exact payload the chat showed. Not for wizard forms. Por defecto: false Ejemplos: 1) A form the chat may offer |
| 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 |