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

Exception on include after a non-static include #15194

Closed
olfway opened this issue Mar 29, 2016 · 3 comments
Closed

Exception on include after a non-static include #15194

olfway opened this issue Mar 29, 2016 · 3 comments
Labels
bug This issue/PR relates to a bug.
Milestone

Comments

@olfway
Copy link

olfway commented Mar 29, 2016

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible 2.1.0 (devel 5fdac707fd) last updated 2016/03/29 10:43:45 (GMT +300)
  lib/ansible/modules/core: (detached HEAD 0268864211) last updated 2016/03/29 10:43:50 (GMT +300)
  lib/ansible/modules/extras: (detached HEAD 6978984244) last updated 2016/03/29 10:43:55 (GMT +300)
  config file =
  configured module search path = Default w/o overrides
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

Exception on include after a non-static one

STEPS TO REPRODUCE

include-test-dynamic-static.yml

- hosts: localhost
  gather_facts: False
  tasks:
    - include: include-test_include-{{ inventory_hostname }}-static.yml

include-test_include-localhost-static.yml

- include: include-test_print-localhost.yml

include-test_print-localhost.yml

- debug: msg="{{ inventory_hostname }}"
EXPECTED RESULTS
TASK [debug] *******************************************************************
task path: /Volumes/Users/int/Development/Ansible/ansible-include/include-test_print-localhost.yml:2
ok: [localhost] => {
    "msg": "localhost"
}
ACTUAL RESULTS

ansible-playbook -i "localhost," -c local -vvv include-test-dynamic-static.yml

TASK [include] *****************************************************************
task path: /Volumes/Users/int/Development/Ansible/ansible-include/include-test-dynamic-static.yml:5
ERROR! Unexpected Exception: 'NoneType' object has no attribute 'get_vars'
the full traceback was:

Traceback (most recent call last):
  File "/Volumes/Users/int/Development/Ansible/ansible/bin/ansible-playbook", line 86, in <module>
    sys.exit(cli.run())
  File "/Volumes/Users/int/Development/Ansible/ansible/lib/ansible/cli/playbook.py", line 151, in run
    results = pbex.run()
  File "/Volumes/Users/int/Development/Ansible/ansible/lib/ansible/executor/playbook_executor.py", line 141, in run
    result = self._tqm.run(play=play)
  File "/Volumes/Users/int/Development/Ansible/ansible/lib/ansible/executor/task_queue_manager.py", line 246, in run
    play_return = strategy.run(iterator, play_context)
  File "/Volumes/Users/int/Development/Ansible/ansible/lib/ansible/plugins/strategy/linear.py", line 305, in run
    new_blocks = self._load_included_file(included_file, iterator=iterator)
  File "/Volumes/Users/int/Development/Ansible/ansible/lib/ansible/plugins/strategy/__init__.py", line 463, in _load_included_file
    loader=self._loader
  File "/Volumes/Users/int/Development/Ansible/ansible/lib/ansible/playbook/helpers.py", line 58, in load_list_of_blocks
    loader=loader
  File "/Volumes/Users/int/Development/Ansible/ansible/lib/ansible/playbook/block.py", line 81, in load
    return b.load_data(data, variable_manager=variable_manager, loader=loader)
  File "/Volumes/Users/int/Development/Ansible/ansible/lib/ansible/playbook/base.py", line 200, in load_data
    self._attributes[name] = method(name, ds[name])
  File "/Volumes/Users/int/Development/Ansible/ansible/lib/ansible/playbook/block.py", line 117, in _load_block
    use_handlers=self._use_handlers,
  File "/Volumes/Users/int/Development/Ansible/ansible/lib/ansible/playbook/helpers.py", line 108, in load_list_of_tasks
    all_vars = variable_manager.get_vars(loader=loader, play=play, task=t)
AttributeError: 'NoneType' object has no attribute 'get_vars'
@jimi-c
Copy link
Member

jimi-c commented Mar 30, 2016

This is a different issue I see, but may have been fixed by the same fix as your previous issue. Could you please confirm if you're still seeing this?

@jimi-c jimi-c added bug_report needs_info This issue requires further information. Please answer any outstanding questions. labels Mar 30, 2016
@jimi-c jimi-c added this to the stable-2.0 milestone Mar 30, 2016
@olfway
Copy link
Author

olfway commented Mar 30, 2016

Unfortunately i'm still seeing it with latest checkout

ansible 2.1.0 (devel eab4ce19f3) last updated 2016/03/31 01:43:34 (GMT +300)
  lib/ansible/modules/core: (detached HEAD 0268864211) last updated 2016/03/29 10:43:50 (GMT +300)
  lib/ansible/modules/extras: (detached HEAD 6978984244) last updated 2016/03/29 10:43:55 (GMT +300)

@jimi-c jimi-c removed the needs_info This issue requires further information. Please answer any outstanding questions. label Mar 31, 2016
@jimi-c jimi-c closed this as completed in a8dbd3d Mar 31, 2016
@jimi-c
Copy link
Member

jimi-c commented Mar 31, 2016

Closing This Ticket

Hi!

We believe the above commit should resolve this problem for you. This will also be included in the next release.

If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:

Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved.

Thank you!

@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