Class: Ansible::Ruby::Modules::Include_role

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/utilities/logic/include_role.rb

Overview

Loads and executes a role as a task dynamically. This frees roles from the ‘roles:` directive and allows them to be treated more as tasks. Unlike M(import_role), most keywords, including loops and conditionals, apply to this statement. This module is also supported for Windows targets.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#allow_duplicates:yes, ...

Returns Overrides the role’s metadata setting to allow using a role more than once with the same parameters.

Returns:

  • (:yes, :no, nil)

    Overrides the role’s metadata setting to allow using a role more than once with the same parameters.



34
# File 'lib/ansible/ruby/modules/generated/utilities/logic/include_role.rb', line 34

attribute :allow_duplicates

#applyHash?

Returns Accepts a hash of task keywords (e.g. C(tags), C(become)) that will be applied to the tasks within the include.

Returns:

  • (Hash, nil)

    Accepts a hash of task keywords (e.g. C(tags), C(become)) that will be applied to the tasks within the include.



14
# File 'lib/ansible/ruby/modules/generated/utilities/logic/include_role.rb', line 14

attribute :apply

#defaults_fromString?

Returns File to load from a role’s C(defaults/) directory.

Returns:

  • (String, nil)

    File to load from a role’s C(defaults/) directory.



30
# File 'lib/ansible/ruby/modules/generated/utilities/logic/include_role.rb', line 30

attribute :defaults_from

#nameString

Returns The name of the role to be executed.

Returns:

  • (String)

    The name of the role to be executed.



18
# File 'lib/ansible/ruby/modules/generated/utilities/logic/include_role.rb', line 18

attribute :name

#privateObject?

Returns This option is a no op, and the functionality described in previous versions was not implemented. This option will be removed in Ansible v2.8.

Returns:

  • (Object, nil)

    This option is a no op, and the functionality described in previous versions was not implemented. This option will be removed in Ansible v2.8.



38
# File 'lib/ansible/ruby/modules/generated/utilities/logic/include_role.rb', line 38

attribute :private

#public:yes, ...

Returns This option dictates whether the role’s C(vars) and C(defaults) are exposed to the playbook. If set to C(yes) the variables will be available to tasks following the C(include_role) task. This functionality differs from standard variable exposure for roles listed under the C(roles) header or C(import_role) as they are exposed at playbook parsing time, and available to earlier roles and tasks as well.

Returns:

  • (:yes, :no, nil)

    This option dictates whether the role’s C(vars) and C(defaults) are exposed to the playbook. If set to C(yes) the variables will be available to tasks following the C(include_role) task. This functionality differs from standard variable exposure for roles listed under the C(roles) header or C(import_role) as they are exposed at playbook parsing time, and available to earlier roles and tasks as well.



41
# File 'lib/ansible/ruby/modules/generated/utilities/logic/include_role.rb', line 41

attribute :public

#tasks_fromString?

Returns File to load from a role’s C(tasks/) directory.

Returns:

  • (String, nil)

    File to load from a role’s C(tasks/) directory.



22
# File 'lib/ansible/ruby/modules/generated/utilities/logic/include_role.rb', line 22

attribute :tasks_from

#vars_fromString?

Returns File to load from a role’s C(vars/) directory.

Returns:

  • (String, nil)

    File to load from a role’s C(vars/) directory.



26
# File 'lib/ansible/ruby/modules/generated/utilities/logic/include_role.rb', line 26

attribute :vars_from