You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In upgrade role there are include_vars tasks used without the name parameter what loads variables at top level with higher precedence than task vars.
So having in upgrade role:
- name: Node Exporter | Include specification vars from node_exporter role
include_vars:
file: roles/node_exporter/vars/main.yml
causes that specification of node_exporter is global with high precedence.
Then the following task (postgresql upgrade is run after node_exporter) has unexpected content (from node_exporter) in specification var:
Expected behavior
Task include_vars should be used with name parameter, for example:
- name: Node Exporter | Include specification vars from node_exporter role
include_vars:
file: roles/node_exporter/vars/main.yml
name: node_exporter_vars
then specification would not override task vars but be available under node_exporter_vars.specification.
Additional context
Having globally loaded vars with high precedence may cause difficult to debug errors.
For local vars we can use underscore in names, e.g. _specification.
DoD checklist
Changelog updated (if affected version was released)
COMPONENTS.md updated / doesn't need to be updated
Automated tests passed (QA pipelines)
apply
upgrade
Case covered by automated test (if possible)
Idempotency tested
Documentation updated / doesn't need to be updated
All conversations in PR resolved
Backport tasks created / doesn't need to be backported
The text was updated successfully, but these errors were encountered:
Describe the bug
In
upgrade
role there areinclude_vars
tasks used without thename
parameter what loads variables at top level with higher precedence than task vars.So having in upgrade role:
causes that
specification
ofnode_exporter
is global with high precedence.Then the following task (
postgresql
upgrade is run afternode_exporter
) has unexpected content (fromnode_exporter
) inspecification
var:Expected behavior
Task
include_vars
should be used withname
parameter, for example:then
specification
would not override task vars but be available undernode_exporter_vars.specification
.Additional context
Having globally loaded vars with high precedence may cause difficult to debug errors.
For local vars we can use underscore in names, e.g.
_specification
.DoD checklist
The text was updated successfully, but these errors were encountered: