Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/docsite/rst/porting_guides/porting_guide_2.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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
-----------------------------------

Expand Down