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

v2 regression: delegate_to in a loop doesn't show [delegater -> delegatee] in output #13014

Closed
amenonsen opened this issue Nov 3, 2015 · 3 comments
Labels
bug This issue/PR relates to a bug.
Milestone

Comments

@amenonsen
Copy link
Contributor

With current ansible devel, the following play:

- hosts: localhost
  tasks:
    - command: echo "{{inventory_hostname}}"
      delegate_to: "foo{{item}}"
      with_items: [1,2,3]

displays the following output:

TASK [command] *****************************************************************
changed: [localhost] => (item=1)
changed: [localhost] => (item=2)
changed: [localhost] => (item=3)

whereas with Ansible 1.9, it displays this:

TASK: [command echo "{{ inventory_hostname }}"] ******************************* 
changed: [localhost -> foo1] => (item=1)
changed: [localhost -> foo2] => (item=2)
changed: [localhost -> foo3] => (item=3)

Because of the incorrect output, I can't be sure if the delegation is actually working as intended/as it did before (because the hosts I'm delegating to all have ansible_connection=local).

@amenonsen
Copy link
Contributor Author

Update: the actual delegation does appear to be working, it's only the output that is wrong.

@bcoca bcoca added this to the v2 milestone Nov 3, 2015
@jimi-c
Copy link
Member

jimi-c commented Nov 9, 2015

Tracked this down to callback/default.py, as we're not adding the delegated to info in the v2_playbook_item_on_* methods. The problem here is that in the example case above we don't template (as we don't have any variables in the callback method) so the value containing a variable isn't templated. This means each item above would show localhost -> foo{{item}} instead of the proper value.

@jimi-c jimi-c closed this as completed in a99f2fd Nov 10, 2015
@jimi-c
Copy link
Member

jimi-c commented Nov 10, 2015

Closing This Ticket

Hi!

We believe the above commit should resolve this problem for you. This will also be included in the next major 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

4 participants