Merge "Generate local Kolla Ansible config in check mode"

This commit is contained in:
Zuul 2023-11-08 18:26:14 +00:00 committed by Gerrit Code Review
commit 63f9aa4ef1
3 changed files with 42 additions and 8 deletions

View File

@ -105,15 +105,15 @@ class KayobeAnsibleMixin(object):
tags = None if install else "config"
playbooks = _build_playbook_list("kolla-ansible")
self.run_kayobe_playbooks(parsed_args, playbooks, tags=tags,
ignore_limit=True)
ignore_limit=True, check=False)
if service_config:
playbooks = _build_playbook_list("kolla-openstack")
self.run_kayobe_playbooks(parsed_args, playbooks,
ignore_limit=True)
ignore_limit=True, check=False)
if bifrost_config:
playbooks = _build_playbook_list("kolla-bifrost")
self.run_kayobe_playbooks(parsed_args, playbooks,
ignore_limit=True)
ignore_limit=True, check=False)
class KollaAnsibleMixin(object):
@ -261,7 +261,7 @@ class ControlHostBootstrap(KayobeAnsibleMixin, KollaAnsibleMixin, VaultMixin,
ka_tags = "install"
playbooks = _build_playbook_list("kolla-ansible")
self.run_kayobe_playbooks(parsed_args, playbooks, tags=ka_tags,
ignore_limit=True)
ignore_limit=True, check=False)
if passwords_exist:
# If we are bootstrapping a control host for an existing
@ -301,7 +301,7 @@ class ControlHostUpgrade(KayobeAnsibleMixin, VaultMixin, Command):
self.run_kayobe_playbooks(parsed_args, playbooks, ignore_limit=True)
playbooks = _build_playbook_list("kolla-ansible")
self.run_kayobe_playbooks(parsed_args, playbooks, tags="install",
ignore_limit=True)
ignore_limit=True, check=False)
class ConfigurationDump(KayobeAnsibleMixin, VaultMixin, Command):

View File

@ -62,7 +62,8 @@ class TestCase(unittest.TestCase):
mock.ANY,
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags="install",
ignore_limit=True
ignore_limit=True,
check=False,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)
@ -95,7 +96,8 @@ class TestCase(unittest.TestCase):
mock.ANY,
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags=None,
ignore_limit=True
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
@ -140,7 +142,8 @@ class TestCase(unittest.TestCase):
mock.ANY,
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags="install",
ignore_limit=True
ignore_limit=True,
check=False,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)
@ -811,11 +814,13 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags="config",
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
[utils.get_data_files_path("ansible", "kolla-bifrost.yml")],
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
@ -861,11 +866,13 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags="config",
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
[utils.get_data_files_path("ansible", "kolla-bifrost.yml")],
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
@ -1120,6 +1127,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags="config",
ignore_limit=True,
check=False,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)
@ -1218,6 +1226,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags="config",
ignore_limit=True,
check=False,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)
@ -1428,6 +1437,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags="config",
ignore_limit=True,
check=False,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)
@ -1459,6 +1469,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags="config",
ignore_limit=True,
check=False,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)
@ -1489,6 +1500,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags="config",
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
@ -1497,6 +1509,7 @@ class TestCase(unittest.TestCase):
"kolla-openstack.yml"),
],
ignore_limit=True,
check=False,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)
@ -1528,6 +1541,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
tags="config",
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
@ -1536,6 +1550,7 @@ class TestCase(unittest.TestCase):
"kolla-openstack.yml"),
],
ignore_limit=True,
check=False,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)
@ -1589,6 +1604,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
ignore_limit=True,
tags="config",
check=False,
),
mock.call(
mock.ANY,
@ -1597,6 +1613,7 @@ class TestCase(unittest.TestCase):
"kolla-openstack.yml"),
],
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
@ -1654,6 +1671,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
ignore_limit=True,
tags="config",
check=False,
),
mock.call(
mock.ANY,
@ -1662,6 +1680,7 @@ class TestCase(unittest.TestCase):
"kolla-openstack.yml"),
],
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
@ -1707,6 +1726,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
ignore_limit=True,
tags="config",
check=False,
),
mock.call(
mock.ANY,
@ -1715,6 +1735,7 @@ class TestCase(unittest.TestCase):
"kolla-openstack.yml"),
],
ignore_limit=True,
check=False,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)
@ -1745,6 +1766,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
ignore_limit=True,
tags="config",
check=False,
),
mock.call(
mock.ANY,
@ -1753,6 +1775,7 @@ class TestCase(unittest.TestCase):
"kolla-openstack.yml"),
],
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
@ -1809,6 +1832,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
ignore_limit=True,
tags="config",
check=False,
),
mock.call(
mock.ANY,
@ -1817,6 +1841,7 @@ class TestCase(unittest.TestCase):
"kolla-openstack.yml"),
],
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
@ -1873,6 +1898,7 @@ class TestCase(unittest.TestCase):
[utils.get_data_files_path("ansible", "kolla-ansible.yml")],
ignore_limit=True,
tags=None,
check=False,
),
mock.call(
mock.ANY,
@ -1881,6 +1907,7 @@ class TestCase(unittest.TestCase):
"kolla-openstack.yml"),
],
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixes an issue where local configuration generation would be skipped when
running in check mode. This would lead to Kolla Ansible checking with stale
configuration. See `story 2010526
<https://storyboard.openstack.org/#!/story/2010526>`__ for details.