diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index 71f354d2d..464d83b0e 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -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): diff --git a/kayobe/tests/unit/cli/test_commands.py b/kayobe/tests/unit/cli/test_commands.py index 54f0c1383..38d6f9664 100644 --- a/kayobe/tests/unit/cli/test_commands.py +++ b/kayobe/tests/unit/cli/test_commands.py @@ -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, diff --git a/releasenotes/notes/check-mode-local-config-3f8a4ba231a32c1f.yaml b/releasenotes/notes/check-mode-local-config-3f8a4ba231a32c1f.yaml new file mode 100644 index 000000000..fba1aa222 --- /dev/null +++ b/releasenotes/notes/check-mode-local-config-3f8a4ba231a32c1f.yaml @@ -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 + `__ for details.