Add porting guide note about inline vars on import/include_tasks (#47121)

* Add porting guide note about inline vars. Fixes #47102
This commit is contained in:
Matt Martz 2018-10-16 10:33:40 -05:00 committed by Alicia Cozine
parent 1ec71e503e
commit abe64775cf

View file

@ -71,6 +71,25 @@ In Ansible 2.7 a new module argument named ``public`` was added to the ``include
There is an important difference in the way that ``include_role`` (dynamic) will expose the role's variables, as opposed to ``import_role`` (static). ``import_role`` is a pre-processor, and the ``defaults`` and ``vars`` are evaluated at playbook parsing, making the variables available to tasks and roles listed at any point in the play. ``include_role`` is a conditional task, and the ``defaults`` and ``vars`` are evaluated at execution time, making the variables available to tasks and roles listed *after* the ``include_role`` task. There is an important difference in the way that ``include_role`` (dynamic) will expose the role's variables, as opposed to ``import_role`` (static). ``import_role`` is a pre-processor, and the ``defaults`` and ``vars`` are evaluated at playbook parsing, making the variables available to tasks and roles listed at any point in the play. ``include_role`` is a conditional task, and the ``defaults`` and ``vars`` are evaluated at execution time, making the variables available to tasks and roles listed *after* the ``include_role`` task.
include_tasks/import_tasks inline variables
-------------------------------------------
As of Ansible 2.7, `include_tasks` and `import_tasks` can no longer accept inline variables. Instead of using inline variables, tasks should supply variables under the ``vars`` keyword.
**OLD** In Ansible 2.6 (and earlier) the following was valid syntax for specifying variables:
.. code-block:: yaml
- include_tasks: include_me.yml variable=value
**NEW** In Ansible 2.7 the task should be changed to use the ``vars`` keyword:
.. code-block:: yaml
- include_tasks: include_me.yml
vars:
variable: value
vars_prompt with unknown algorithms vars_prompt with unknown algorithms
----------------------------------- -----------------------------------