Designer

Edit forms, playbooks, inventories and workflows in the browser

  1. Its sections
  2. The file explorers
  3. Its tabs
  4. The toolbar
  5. Import
  6. Restore an earlier version
  7. Local inventories
  8. Limited designers

For form authors: the designer’s sections, and what each of their tabs shows.

The designer needs the showDesigner role option. It edits one item at a time, a form, a playbook or a workflow file, with its sections in the left menu. Each kind of file also needs its own option, all on by default: allowPlaybookDesign for the Playbooks, allowWorkflowDesign for the Workflows, allowInventoryDesign for the Inventories and allowVarsFileDesign for the Vars files. Without one, its section is read-only and the server refuses to save, create, remove or push its files; forms and workflows can still pick them. The Forms, Categories and Constants need allowFormDesign the same way: without it they are read-only, and the server refuses to save, pull or push them. A role can also hide the forms, playbooks and workflows of other teams: see Limited designers. Only one person edits at a time: see The designer lock.


Its sections

Each section edits one kind of file, kept locally or in a repository:

Section What it edits
Forms The form files
Categories The categories, in one file or spread over several (see Roles, categories and constants)
Constants The constants, in one file or spread over several, as the categories
Vars files The vars files that forms load
Playbooks The playbooks that forms and workflows run: the first playbooks repository’s, then each other one in a folder named after it
Inventories The inventories: inventory.yaml, group_vars and host_vars
Workflows The workflow files
Runtime environments The runtime environments a builder builds, from 7.9.0

Every section lists its files in a file explorer beside its editor and opens the first one; a section with no files yet says so.


The file explorers

From 7.9.0 every section’s file explorer works the same way, with the same buttons in its header.

Button What it does
> Folds the explorer away, to give the editor the room; the same button brings it back
Collapse all Folds every folder, and unfolds them all again once they are all folded
Search The magnifying glass opens a box that filters the files by name
New folder, New file A folder or a file at the path you type. In Forms, Categories, Constants, Playbooks, Vars files and Workflows

The file clicked is the one the editor opens, and a file is deleted with the red × on its row, after a question naming it. A folder is kept once a file is saved in it. The Inventories list each inventory with its group_vars and host_vars files, and the Runtime environments each definition, with New runtime environment in the header.

The search box on the title line finds a text in the YAML that is open: it marks every place it appears. It works on the YAML tab, once the designer lock is yours.


Its tabs

Every section has the same three tabs, all on the same YAML: an edit in one shows in the others, and Save saves it.

  • YAML is the file as it is written.
  • Visual edits it with fields. Only the keys an edit touches change, so comments and the rest stay as written.
  • Preview shows what it does, and edits nothing.

What the Visual and Preview tabs show, section by section:

Section Visual Preview
Forms The form’s settings and its fields, with lists of the designer’s playbooks (and their repository), inventories and workflows The form as it is now, unsaved edits included; its submit runs nothing
Categories The categories as a table, edited The Forms page’s menu, built from them
Constants The constants as an outline, edited (a key moves with the arrow keys) Each constant with its reference, $(NAME), to copy, and the forms that use it
Vars files The variables, edited Each variable with its reference in a playbook, {{ name }}, to copy, and the forms that load the file
Playbooks The plays: each play’s name, hosts, Become, Gather facts and roles, and its tasks, each with its module and arguments The playbook’s outline: its plays, with their hosts, roles and tasks, and the playbooks it imports
Inventories The groups, their child groups, their hosts, and the variables each sets The inventory as a tree, with its group_vars and host_vars
Workflows The workflow’s graph, to edit it A dry run: click a node to make it fail

When the YAML cannot be read, the Visual and Preview tabs say why, with Show in YAML to open the YAML on the line.


The toolbar

From 7.9.0 every section has the same toolbar: the same action has the same icon, in the same place, in every section.

A button a section has is always shown, and greyed out while it cannot act, such as Push before there is anything to push.

Button What it does
New file First on every toolbar: a new form file, a new categories or constants file, a playbook, a vars file. In the Inventories it is New inventory, in the Workflows New workflow, in the Runtime environments New runtime environment
Import Brings in content from a file of your computer, see Import
Validate Checks what is open. In the Forms, Categories and Constants the whole configuration, as before; in every YAML file (playbooks, vars files, inventories, workflows, runtime environments) its YAML: The YAML is valid., or why not
Save Writes the edits; Save (local) in a section with a repository
Push Commits and pushes the repository, orange while saved changes wait for it. Content in no repository yet asks where it goes, see Pushing local content
Restore Puts back an earlier version, see Restore an earlier version
Add On the Visual tab: a field, a category, a constant, or a variable of the vars file open
Reload One in every section. The Forms, Categories and Constants pull their repositories first when there are (Load (repository)), else are read again; the other sections read their files again
Revert Back to the file as it was last saved

The YAML tab adds the text editor’s buttons in every section, the Runtime environments included: undo, redo, cut, copy, paste, format, find and replace, the changes since the last save, and Download YAML.


Import

From 7.9.0 every section has an Import, greyed out while the section cannot write.

Section What it imports
Forms The forms of a YAML file, ticked in a list, into the forms file chosen; a name already taken is imported under a new one
Categories, Constants, Runtime environments The entries of a YAML file, ticked in a list. The categories and constants go into the file open, a runtime environment is saved as a new one; a name already there is marked already there and skipped
Playbooks, Vars files, Workflows One file from your computer as a new file, at the path you give, checked as it is typed. A vars file or a workflow file must be YAML
Inventories A YAML or INI file as a new local inventory: its inventory.yaml or inventory.ini, under the name you give, checked as New inventory checks it

Restore an earlier version

From 7.9.0 every section can put back an earlier version of what is open, in one dialog.

Section The versions listed
Playbooks, Vars files, Inventories, Workflows A file in a repository: its git history, the latest 30 commits, its renames followed. A local file: a snapshot of each save, the text the save replaced, the latest 10 per file
Runtime environments The git history of the file holding the definition, each version showing that definition’s entry
Forms, Categories, Constants The configuration backups, as before (only without a forms repository, or with the configuration in the database)

Restore an earlier version lists the versions, newest first. A version picked shows how it differs from the text open, under What Restore changes; Restore puts it in the editor, unsaved, so Save keeps it and Revert drops it. A version of a runtime environment’s file without its entry shows the whole file, and cannot be restored. The local snapshots are kept in a hidden folder of FORMS_BACKUP_PATH.


Local inventories

From 7.9.0 New inventory makes the inventory in the local inventories folder first, so no repository is needed to start one.

It asks the inventory’s name first, checked as it is typed: letters, digits, dots, dashes and underscores, and no inventory of that name yet. The inventory is then a folder of INVENTORY_PATH with its inventory.yaml and group_vars/all.yaml, and a form names it with inventory: as any other.

Its Push, orange once it is saved, saves it in git: each inventories repository is one inventory, so it always goes into a new repository. The repositories’ New dialog opens, named after the inventory and with the Inventories usage ticked; once the repository is cloned, the inventory moves into it and is pushed. This needs allowInventoryDesign and access to Settings > Repositories.


Limited designers

From 7.5.0 three role options limit which forms, playbooks and workflows the designer shows, so each team designs its own. All three are on by default and always on for admins:

Option Turned off, the designer shows only
designAllForms (Edit All Forms) The forms whose roles hold one of the user’s roles, and the subforms no hidden form uses
designAllPlaybooks (Edit All Playbooks) The playbooks the user’s forms run, and the ones no form uses yet
designAllWorkflows (Edit All Workflows) The workflow files the user’s forms run, nested ones included, and the ones no form uses yet

A form runs a playbook through its playbook, its ansible steps and the workflows it runs, counted with the repository it names (playbookRepository, since 7.8.0, __self__ being the one the form is in): playbooks/site.yml of one repository is not site.yml of another. See A repository in Ansible’s own layout. What a limited designer cannot do:

  • See a hidden file. It is never listed nor named: opening one answers as a missing file, and a new file with its name as a file that is already there.
  • Point at one. A form that names a hidden form as a subform shows nothing of it, and a form or workflow file that names a hidden playbook or workflow is refused.
  • Change a shared subform. A subform that a hidden form uses too is read-only, and a saved form must keep one of the user’s roles.
  • Touch the hidden forms of a file. A file holding several forms keeps the hidden ones as they are on a save, and restoring a forms backup is refused.
  • Add code the server runs. A saved form may not gain an expression or a query the server runs, and the preview of a form not saved yet runs no expression of its own.
  • Read file names in git output. The output of a pull or a push leaves out the lines that name files.

allowFormDesign, allowPlaybookDesign and allowWorkflowDesign still decide whether the files shown can be changed. Inventories, vars files, categories and constants stay visible to every designer. A user with only part of the settings sees only their own forms and workflow files on the settings pages’ Forms tabs and on a credential’s Used by tab.