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

ansible.builtin.include_vars does not work with registered result #74970

Closed
1 task done
vbotka opened this issue Jun 11, 2021 · 2 comments
Closed
1 task done

ansible.builtin.include_vars does not work with registered result #74970

vbotka opened this issue Jun 11, 2021 · 2 comments
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@vbotka
Copy link
Contributor

vbotka commented Jun 11, 2021

Summary

include_vars does not expand nested variables when the result of the module is registered
(For the record: Origin bug #71818 fixed by #71824)

Issue Type

Bug Report

Component Name

ansible.builtin.include_vars

Ansible Version

$ ansible --version
ansible 2.10.10
  config file = /export/scratch/tmp9/ansible.cfg
  configured module search path = ['/home/admin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]

Configuration

$ ansible-config dump --only-changed
DEFAULT_HOST_LIST(/export/scratch/tmp9/ansible.cfg) = ['/scratch/tmp9/hosts']
DEFAULT_ROLES_PATH(/export/scratch/tmp9/ansible.cfg) = ['/scratch/tmp9/roles']
DEFAULT_STDOUT_CALLBACK(/export/scratch/tmp9/ansible.cfg) = yaml
RETRY_FILES_ENABLED(/export/scratch/tmp9/ansible.cfg) = False

OS / Environment

Ubuntu 20.04

Steps to Reproduce

Give n the file

shell> cat testvars.yml 
---
test: "{{ foo }}"
foo: bar

the block below

    - block:
        - ansible.builtin.include_vars:
            file: testvars.yml
        - debug:
            var: test

gives

  test: bar

But, when the result is registered

    - block:
        - ansible.builtin.include_vars:
            file: testvars.yml
          register: result
        - debug:
            var: test

the variable won't be expanded

  test: '{{ foo }}'

Expected Results

The registered variable should not break the expansion of the included variables.

Actual Results

See **Steps to Reproduce**

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot
Copy link
Contributor

ansibot commented Jun 11, 2021

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jun 11, 2021
@mkrizek
Copy link
Contributor

mkrizek commented Jun 11, 2021

This has been fixed recently in #73161.

Duplicate of #21088.

If you have further questions please stop by IRC or the mailing list:

@mkrizek mkrizek closed this as completed Jun 11, 2021
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Jun 11, 2021
@ansible ansible locked and limited conversation to collaborators Jul 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

3 participants