Update openrc files after overcloud service upgrade

We could end up with openrc files not matching the latest templates
after an upgrade.

Change-Id: I2dbaed7d698b630b1c79cf72fa338e29148dd6e7
This commit is contained in:
Pierre Riteau 2020-06-05 12:58:15 +02:00
parent 222cd5fdde
commit a633536bfa
3 changed files with 25 additions and 0 deletions

View File

@ -1370,6 +1370,7 @@ class OvercloudServiceUpgrade(KollaAnsibleMixin, KayobeAnsibleMixin,
deployment.
* Perform a kolla-ansible upgrade of the overcloud services.
* Configure and upgrade kayobe extra services.
* Regenerate openrc files for the admin user.
This can be used in conjunction with the --tags and --kolla-tags arguments
to upgrade specific services.
@ -1401,6 +1402,13 @@ class OvercloudServiceUpgrade(KollaAnsibleMixin, KayobeAnsibleMixin,
self.run_kayobe_playbooks(parsed_args, playbooks,
extra_vars=extra_vars, limit="overcloud")
# Post-deployment configuration.
self.run_kolla_ansible_overcloud(parsed_args, "post-deploy")
# Create an environment file for accessing the public API as the admin
# user.
playbooks = _build_playbook_list("public-openrc")
self.run_kayobe_playbooks(parsed_args, playbooks, ignore_limit=True)
class OvercloudServiceDestroy(KollaAnsibleMixin, KayobeAnsibleMixin,
VaultMixin, Command):

View File

@ -1553,6 +1553,14 @@ class TestCase(unittest.TestCase):
"kayobe_action": "upgrade",
}
),
mock.call(
mock.ANY,
[
utils.get_data_files_path("ansible",
"public-openrc.yml"),
],
ignore_limit=True,
),
]
self.assertEqual(expected_calls, mock_run.call_args_list)
@ -1565,6 +1573,10 @@ class TestCase(unittest.TestCase):
mock.ANY,
"upgrade"
),
mock.call(
mock.ANY,
"post-deploy"
),
]
self.assertEqual(expected_calls, mock_kolla_run.call_args_list)

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Kayobe now updates ``openrc`` files when using the ``kayobe overcloud service
upgrade`` command.