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

Deprecation warning when using with_items with undefined variable #14526

Closed
hagbarddenstore opened this issue Feb 17, 2016 · 0 comments
Closed
Labels
bug This issue/PR relates to a bug.
Milestone

Comments

@hagbarddenstore
Copy link

Issue Type:

Bug Report

Ansible Version:
ansible --version
ansible 2.0.0.2
Ansible Configuration:

No changes.

Environment:

Mac OS X 10.11.3

Summary:

When using a defined variable which uses an undefined variable in an with_items statement, I get a deprecation warning rather than an actual error message.

Steps To Reproduce:

The following playbook.yml:


---
- hosts: localhost

  gather_facts: no

  connection: local

  tasks:
    - debug:
        var=item
      with_items: mysql_users

  vars:
    mysql_passwords:
        user: password

    mysql_users:
        - name: user
          password: "{{ mysql_passwords['user'] }}"

        - name: fake
          password: "{{ mysql_passwords['fake'] }}"

Run:

ansible-playbook playbook.yml
Expected Results:

An error message pointing me towards the variable that's missing or the very least which file produced the error.

Actual Results:
ansible-playbook playbook.yml

PLAY ***************************************************************************

TASK [debug] *******************************************************************
[DEPRECATION WARNING]: Skipping task due to undefined attribute, in the future this will be a fatal error.. This feature will be removed in a future release. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.

PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=0
@hagbarddenstore hagbarddenstore changed the title Deprecation error when using with_items Deprecation warning when using with_items Feb 17, 2016
@hagbarddenstore hagbarddenstore changed the title Deprecation warning when using with_items Deprecation warning when using with_items with undefined variable Feb 17, 2016
@bcoca bcoca added this to the stable-2.0 milestone Feb 18, 2016
@bcoca bcoca closed this as completed in d54d9da Feb 18, 2016
jimi-c pushed a commit that referenced this issue Feb 25, 2016
should now show actual variable that is undefined
fixes #14526
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants