mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Support iteration over command output in with_items.
When the output of a command is stored in a register, this will create a stdout_lines field in the result object that contains stdout split into a list of lines. This list can then be iterated over using with_items.
This commit is contained in:
@@ -258,6 +258,8 @@ class PlayBook(object):
|
||||
facts = result.get('ansible_facts', {})
|
||||
self.SETUP_CACHE[host].update(facts)
|
||||
if task.register:
|
||||
if 'stdout' in result:
|
||||
result['stdout_lines'] = result['stdout'].splitlines()
|
||||
self.SETUP_CACHE[host][task.register] = result
|
||||
|
||||
# flag which notify handlers need to be run
|
||||
|
||||
Reference in New Issue
Block a user