+

Search Tips   |   Advanced Search

ansible.builtin.constructed - Uses Jinja2 to construct vars and groups based on existing inventory.

This module is part of ansible-base and included in all Ansible installations. In most cases, you can use the short module name constructed even without specifying the collections: keyword. Despite that, we recommend you use the FQCN for easy linking to the module documentation and to avoid conflicting with other collections that may have the same module name.

New in version 2.4: of ansible.builtin


Synopsis


Parameters

Parameter Choices/Defaults Configuration Comments

compose

dictionary

Default:

{}

Create vars from jinja2 expressions.

groups

dictionary

Default:

{}

Add hosts to group based on Jinja2 conditionals.

keyed_groups

list / elements=string

Default:

[]

Add hosts to group based on the values of a variable.

plugin

string / required

  • constructed

token that ensures this is a source file for the 'constructed' plugin.

strict

boolean

  • no ←
  • yes

If yes make invalid entries a fatal error, otherwise skip and continue.

Since it is possible to use facts in the expressions they might not always be available and we ignore those errors by default.



Examples