To recognize Ansible files, OrchidE needs two basic settings:
- the root folders where the playbooks, roles and inventories are located.
- a pattern set to recognize if it is a playbook, task or variable file
The root folders are configured in the settings under File | Settings | Languages & Frameworks | OrchidE | Ansible Folder Mapping.
For a ‘Single Ansible role project’ the checkbox “Single Ansible role project” above the section Role Root Folders needs to be selected.
This will use the IntelliJ project folder as the root folder for the role and default pattern sets regardless of the settings in “File Type Patterns”.
The molecule folder is currently not automatically supported in the ‘Single Ansible role project’. To detect files in molecule folders, custom patterns for playbooks and tasks are required.
The default pattern to recognize playbooks, roles and inventory variables files are configured for the following layout:
project |-- inventory | |-- hosts | |-- group_vars | | |-- webservers | | | |-- default.yml |-- playbooks | |-- webservers | | -- main.yml |-- roles | |-- webserver | | |-- tasks | | | |-- main.yml
Alternatively, playbooks can also be stored directly in the playbooks folder.
Additional patterns for different directory structures can be defined via the settings for the “File Type Pattern”.
(File | Settings | Languages & Frameworks | OrchidE | File Type Patterns)
Meaning of the Ansible Types:
- Standard type for the detection of playbooks. With this type the file name of a playbook file is interpreted as playbook name (for use in navigation)
- Detection of playbook files within a subfolder. With this type the parent folder of a playbook file is used as playbook name. This can be used to create a categorization of playbooks (playbook name is used for navigation)
- Type for the recognition of files containing tasks. For splitting playbooks when no roles are used (include_tasks). Do not use this type for roles.
- Type for tasks and handlers in roles
- Type for defaults und vars file in roles
Note: Patterns of this type must explicitly apply to a specific role. For this, use the placeholder “%s” to match the role name.
|-- roles | |-- webserver | | |-- defaults | | | |-- main.yml
- Generic type for all files containing Ansible variables (role vars/defaults, host vars, group vars, included files). With this type, patterns for the role variables must be included again.
File Type Pattern Reset Configuration
The OrchidE plugin default settings can be restored via the toolbar button ().