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

return changed for group_by #32057

Open
wants to merge 1 commit into
base: devel
from

Conversation

@bcoca
Member

bcoca commented Oct 24, 2017

SUMMARY

fixed the use of incorrect functions for lookup
made sure we return the correct 'changed' status

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

group_by
strategy

ANSIBLE VERSION
2.4/2.5
@tedder

This comment has been minimized.

Contributor

tedder commented Nov 14, 2017

Looks like this may fix #32152, so backporting to 2.4 would be nice.

Doesn't fix that issue.

@@ -633,6 +633,7 @@ def _add_group(self, host, result_item):
group_name = result_item.get('add_group')
parent_group_names = result_item.get('parent_groups', [])
changed = False

This comment has been minimized.

@tedder

tedder Nov 14, 2017

Contributor

changed=false is defined about 5 lines up.

@ansibot ansibot removed the stale_ci label Nov 14, 2017

@ansibot ansibot added the stale_ci label Nov 23, 2017

@maxamillion

This comment has been minimized.

Contributor

maxamillion commented Dec 15, 2017

needs_revision

@winstonsimon

This comment has been minimized.

winstonsimon commented Feb 27, 2018

I was hoping this is fixed in 2.5 atleast and Ansible is still broken for AWS users after 2.3.1.0

the full traceback was:

Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 118, in <module>
    exit_code = cli.run()
  File "/usr/lib/python2.7/site-packages/ansible/cli/playbook.py", line 122, in run
    results = pbex.run()
  File "/usr/lib/python2.7/site-packages/ansible/executor/playbook_executor.py", line 159, in run
    result = self._tqm.run(play=play)
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py", line 290, in run
    play_return = strategy.run(iterator, play_context)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.py", line 291, in run
    results += self._wait_on_pending_results(iterator)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/strategy/__init__.py", line 680, in _wait_on_pending_results
    results = self._process_pending_results(iterator)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/strategy/__init__.py", line 117, in inner
    results = func(self, iterator, one_pass=one_pass, max_passes=max_passes)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/strategy/__init__.py", line 592, in _process_pending_results
    self._add_group(original_host, result_item)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/strategy/__init__.py", line 726, in _add_group
    real_host = self._inventory.hosts[host.name]
KeyError: u'localhost'```


Ansible config:
```- hosts: localhost
  connection: local

  tasks:
    - name: Load configuration for {{ envName }}_{{ region }}
      group_by: key="{{ envName }}_{{ region }}"
    - debug:
        msg: hello
@winstonsimon

This comment has been minimized.

winstonsimon commented Feb 27, 2018

ansible 2.5.0rc1
  config file = None
  configured module search path = [u'/winstons/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Apr  9 2015, 11:03:32) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]```
@bcoca

This comment has been minimized.

Member

bcoca commented Feb 27, 2018

@winstonsimon you realize this has not been merged at all?

@winstonsimon

This comment has been minimized.

winstonsimon commented Feb 27, 2018

If all good can you merge this and give us a new version? Issue is we are stuck at 2.3.1.0 and not able to use any new AWS features eg: NLB, Dynamodb etc..

This fix would be extremely helpful for us to move forward with Ansible.

@bcoca bcoca added this to To Do in 2.5.x blocker list via automation Feb 27, 2018

@winstonsimon

This comment has been minimized.

winstonsimon commented Feb 27, 2018

Thanks for adding it to blocker list. Meanwhile can you suggest some workaround to bypass this issue?

@ansibot ansibot added bug and removed bugfix_pull_request labels Mar 2, 2018

@winstonsimon

This comment has been minimized.

winstonsimon commented Mar 6, 2018

When can we expect this change? Any ETA?

@ansibot ansibot removed the stale_ci label Mar 6, 2018

@nitzmahone nitzmahone moved this from To Do to 2.5.1 Holding in 2.5.x blocker list Mar 9, 2018

@ansibot ansibot added the stale_ci label Mar 14, 2018

@ansibot ansibot added the needs_rebase label Apr 7, 2018

@nitzmahone nitzmahone moved this from 2.5.1 Holding to 2.5.2 holding in 2.5.x blocker list Apr 18, 2018

@bcoca bcoca moved this from 2.5.2 holding to To Do in 2.5.x blocker list Apr 27, 2018

@bcoca bcoca removed this from To Do in 2.5.x blocker list May 30, 2018

@bcoca bcoca force-pushed the bcoca:group_by_changed branch from ee2aee1 Jun 1, 2018

@bcoca

This comment has been minimized.

Member

bcoca commented Jun 1, 2018

@winstonsimon I don't think this relates to your issue at all, this is just adding 'changed state' to the group_by action.

If you have a reproducer with your problem please open a ticket, fyi I have not heard any other AWS user report anything similar.

if group in self.groups:
g = self.groups[group]
if child in self.groups:
g.add_child_group(self.groups[child])
added = g.add_child_group(self.groups[child])

This comment has been minimized.

@maxamillion

maxamillion Jun 1, 2018

Contributor

add_child_group doesn't appear to return anything, does this result in a non-falsey value?

@ansibot ansibot added the stale_ci label Jun 9, 2018

@bcoca bcoca force-pushed the bcoca:group_by_changed branch to 7d3e2b4 Jul 17, 2018

@ansibot ansibot added the stale_ci label Jul 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment