PARALLAX

include_role

Load and execute a role in the current play

Collection: builtin

Full Name: parallax.builtin.include_role

Aliases: include_role, ansible.builtin.include_role

Controller module — runs on the local controller, not on remote hosts.

Synopsis

Load and execute a role in the current play

Parameters

NameTypeRequiredDefaultDescription
namestringyesRole to execute in the current play
tasks_fromstringmainTask entry point in the role tasks directory
vars_fromstringmainVariable entry point in the role vars directory
defaults_fromstringmainDefault variable entry point in the role defaults directory
handlers_fromstringmainHandler entry point in the role handlers directory
publicboolfalseExpose role defaults and variables to following tasks
applymapTask keywords applied to the included role tasks
allow_duplicatesbooltrueAllow repeating the same role invocation
rolespec_validatebooltrueValidate the selected role entry point arguments

Example

yaml
- name: Apply the webserver role
  ansible.builtin.include_role:
    name: webserver
    public: false
Search
    ↑ ↓ move↵ openesc close