Propiedades comunes de los formularios

Propiedades que comparten todos los tipos de formulario


Estas propiedades se aplican a todos los tipos de formulario: ansible, awx, aap, ascender, semaphore, rundeck, jenkins, workflow, multistep (obsoleto) y subform.

Las demás propiedades son específicas de cada tipo y se documentan en la página del tipo de formulario correspondiente.

Each form in the forms list is configured with the below attributes.


Propiedades

Las propiedades que comparten todos los tipos de formulario:

Atributo Comentarios
name
string / obligatorio / único

The name of the form
alphanumeric + dash + underscore + space

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.

description
string

Form description
free text

A short description, explaining what the form does.

appVersion
string
añadido en la versión 7.9.0

The versions of AnsibleForms the form is for
a version range, as npm writes them

The versions of AnsibleForms this form is for. A version outside the range does not load the form: no tile, no launch, no relaunch or schedule. Without it, a form is for every version.

  • >=7.9: 7.9 and later
  • <8: before 8.0 (a form being retired)
  • 7.9.x: any 7.9
  • 7.9.2: exactly that version
  • >=7.5 <7.9: from 7.5, before 7.9
  • 7.8.x || >=7.10: one or the other

A release candidate counts as its release: 7.9.0-rc.12 is 7.9.0.

The same form, twice. A form name can be defined more than once when each copy is for other versions: a copy for the version running is loaded, the others are not. Copies whose ranges share a version are duplicates, as before: the first one read is used.

Versions before 7.9 do not know appVersion and reject a form that has it. For them, keep a copy without appVersion and put it first (an earlier file, or higher in the same file): they load it and skip the other copy as a duplicate. From 7.9 on, a copy with appVersion that fits the version wins over the copy without.

The Designer shows every copy, its range next to its name. A copy that is not for the version running is not validated by it (it cannot know what another version accepts): you can edit and save it, with a warning that nothing checks it.

Ejemplos:

1) A copy for the older versions and one for 7.9 and later

# first : the versions before 7.9 load this copy (and skip the other)
- name: Create VM
  type: ansible
  playbook: create_vm.yaml
  fields: []
# 7.9 and later : this copy
- name: Create VM
  type: ansible
  appVersion: ">=7.9"
  playbook: create_vm.yaml
  fields: []

2) A form being retired, a form only for newer versions

- name: Old cleanup
  type: ansible
  appVersion: "<8"
  playbook: cleanup.yaml
- name: New report
  type: ansible
  appVersion: ">=7.10"
  playbook: report.yaml
help
string

Help
valid markdown

Using markdown you can a more detailed help message to help the operator understand the form.

Ejemplos:

1) blockquote with title, list, italic and bold

> #### The quarterly results look great!
>
> - Revenue was off the chart.
> - Profits were higher than ever.
>
>  *Everything* is going according to **plan**.     
type
string

Form type

Our form eventually sends extravars to a target. That target can be an ansible-playbook, an awx-template, a multistep (a sequence of playbooks/templates), or a subform (a reusable form fragment used as the per-row editor of a list field or the single-object editor of a yaml field).

Opciones:
  • ansible
  • aap
  • ascender
  • semaphore
  • rundeck
  • jenkins
  • workflow
  • awx
  • multistep
  • subform

Ejemplos:

1) Run AWX Template Create VM

name: Create vm
type: awx
roles:
  - default
fields: []
template: Create VM       

2) Run Delete VM playbook

name: Delete vm
type: ansible
roles:
  - default
fields: []
playbook: delete_vm.yaml

3) Run multistep job

name: Trigger awx job
type: multistep
roles:
  - default
fields: []
steps:
- name: Create vm
  type: awx
  template: create_vm        
- name: Start vm
  type: awx
  template: start_vm                                 
fields
array

fields
🔗 valid field object

It makes sense that a form has 1 or more formfields. Read more about them in the separate formfield section.

Ejemplos:

1) Examples

fields:
  - name: name
    label: Your name
    type: text
    required: true
  - name: email
    label: Your email
    type: text
    regex:
      expression: '^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$'
      description: Please enter a valid email address
    required: true