Subform
A reusable form fragment for list fields, yaml fields and wizard pages
A subform is a reusable form fragment. It does not appear in the tile view and cannot be submitted directly. Instead, it is referenced by:
- A
listfield — opens the subform as a drilldown editor for each row - A
yamlfield with thesubformproperty — opens the subform as a drilldown editor for a single object - A
wizardstep — renders the subform as one page of the wizard
A reusable form fragment used as the per-row editor of a list field, or as the single-object editor of a yaml field with the subform property.
Subforms are not shown in the tile view and cannot be submitted directly.
They share the same field types and validation rules as regular forms.
Address subform
- name: Address
type: subform
fields:
- name: street
type: text
label: Street
required: true
- name: city
type: text
label: City
required: true
- name: country
type: text
label: Country
required: true
- name: My Main Form
type: ansible
playbook: site.yml
roles:
- Public
fields:
- name: addresses
type: list
label: Addresses
subform: AddressProperties
Subforms have no type-specific properties. They use only the common form properties: name, description, help, type, and fields.
When a subform serves as a wizard page, its description and help provide the defaults for the step’s title and help. It can also set showHelp to expand that help when the page loads.
Execution properties (playbook, template, roles, inventory, etc.) do not apply to subforms, because a subform is never submitted directly.