mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Introduce 'changed_when' keyword to override a task's changed status with the evaluation of a Jinja2 expression
This commit is contained in:
parent
81940c8b11
commit
eb45f07ae3
5 changed files with 75 additions and 6 deletions
|
@ -351,7 +351,7 @@ class PlayBook(object):
|
|||
# extra vars need to always trump - so update again following the facts
|
||||
self.SETUP_CACHE[host].update(self.extra_vars)
|
||||
if task.register:
|
||||
if 'stdout' in result:
|
||||
if 'stdout' in result and 'stdout_lines' not in result:
|
||||
result['stdout_lines'] = result['stdout'].splitlines()
|
||||
self.SETUP_CACHE[host][task.register] = result
|
||||
|
||||
|
@ -359,7 +359,7 @@ class PlayBook(object):
|
|||
if task.ignore_errors and task.register:
|
||||
failed = results.get('failed', {})
|
||||
for host, result in failed.iteritems():
|
||||
if 'stdout' in result:
|
||||
if 'stdout' in result and 'stdout_lines' not in result:
|
||||
result['stdout_lines'] = result['stdout'].splitlines()
|
||||
self.SETUP_CACHE[host][task.register] = result
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue