Merge "Don't run playbooks if role count == 0"
This commit is contained in:
commit
294e42f599
|
@ -406,6 +406,8 @@ class TestRunRolePlaybooks(TestCase):
|
|||
@mock.patch('tripleoclient.utils.run_ansible_playbook')
|
||||
def test_role_playbooks(self, mock_run):
|
||||
roles = [
|
||||
# No playbooks should execute for the role if count is 0.
|
||||
{'count': 0, 'name': 'ZeroNodesRole'},
|
||||
{'count': 10, 'name': 'Compute'},
|
||||
{
|
||||
'count': 3,
|
||||
|
|
|
@ -3002,6 +3002,9 @@ def run_role_playbooks(self, working_dir, roles_file_dir, roles,
|
|||
|
||||
# Pre-Network Config
|
||||
for role in roles:
|
||||
if role.get('count', 1) == 0:
|
||||
continue
|
||||
|
||||
role_playbooks = []
|
||||
|
||||
for x in role.get('ansible_playbooks', []):
|
||||
|
|
Loading…
Reference in New Issue