diff options
author | Brian Coca <bcoca@users.noreply.github.com> | 2017-12-20 16:28:38 -0500 |
---|---|---|
committer | Jordan Borean <jborean93@gmail.com> | 2017-12-21 07:28:38 +1000 |
commit | 8c6d8239637455c97de7bf88dc26066b150b7a8b (patch) | |
tree | 7e6e4961e8cf3545eb3ba320193c330f1abea171 /lib/ansible/playbook | |
parent | 76590ab8a5ec199551019f86d53d41e3550a46ae (diff) | |
download | ansible-8c6d8239637455c97de7bf88dc26066b150b7a8b.tar.gz |
simpler loop_control defaults (#34008)
Diffstat (limited to 'lib/ansible/playbook')
-rw-r--r-- | lib/ansible/playbook/included_file.py | 2 | ||||
-rw-r--r-- | lib/ansible/playbook/loop_control.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/ansible/playbook/included_file.py b/lib/ansible/playbook/included_file.py index ed2205f3f5..68f4712538 100644 --- a/lib/ansible/playbook/included_file.py +++ b/lib/ansible/playbook/included_file.py @@ -85,7 +85,7 @@ class IncludedFile: include_variables = include_result.get('include_variables', dict()) loop_var = 'item' if original_task.loop_control: - loop_var = original_task.loop_control.loop_var or 'item' + loop_var = original_task.loop_control.loop_var if loop_var in include_result: task_vars[loop_var] = include_variables[loop_var] = include_result[loop_var] diff --git a/lib/ansible/playbook/loop_control.py b/lib/ansible/playbook/loop_control.py index b983ee88ed..7fe0ca50ab 100644 --- a/lib/ansible/playbook/loop_control.py +++ b/lib/ansible/playbook/loop_control.py @@ -25,9 +25,9 @@ from ansible.playbook.base import Base class LoopControl(Base): - _loop_var = FieldAttribute(isa='str') + _loop_var = FieldAttribute(isa='str', default='item') _label = FieldAttribute(isa='str') - _pause = FieldAttribute(isa='int') + _pause = FieldAttribute(isa='int', default=0) def __init__(self): super(LoopControl, self).__init__() |