From e3c1efc8653fbba912f8404e382fe9be0ac3528a Mon Sep 17 00:00:00 2001 From: Maksim Malchuk Date: Sun, 9 Jun 2024 19:28:51 +0300 Subject: [PATCH] Set slightly more accurate name for the manage containers role Follow-up on I43a9c2a57fcfe2c9d84f39903aac7c258f9a897f. As discussed before we set slightly more accurate name for the manage containers role since using 'deploy-containers' role with action 'destroy' can be a little confusing. Change-Id: I6d4a3479d492e0fe86ce3de7414fa47c584577ea Signed-off-by: Maksim Malchuk --- ansible/roles/deploy-containers/tasks/main.yml | 2 -- .../defaults/main.yml | 2 +- .../tasks/deploy-container.yml | 0 .../tasks/deploy.yml | 0 .../tasks/destroy-container.yml | 0 .../tasks/destroy.yml | 0 ansible/roles/manage-containers/tasks/main.yml | 2 ++ ansible/seed-deploy-containers.yml | 9 --------- ansible/seed-manage-containers.yml | 10 ++++++++++ .../configuration/reference/seed-custom-containers.rst | 2 +- kayobe/cli/commands.py | 8 ++++---- kayobe/tests/unit/cli/test_commands.py | 6 +++--- 12 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 ansible/roles/deploy-containers/tasks/main.yml rename ansible/roles/{deploy-containers => manage-containers}/defaults/main.yml (92%) rename ansible/roles/{deploy-containers => manage-containers}/tasks/deploy-container.yml (100%) rename ansible/roles/{deploy-containers => manage-containers}/tasks/deploy.yml (100%) rename ansible/roles/{deploy-containers => manage-containers}/tasks/destroy-container.yml (100%) rename ansible/roles/{deploy-containers => manage-containers}/tasks/destroy.yml (100%) create mode 100644 ansible/roles/manage-containers/tasks/main.yml delete mode 100644 ansible/seed-deploy-containers.yml create mode 100644 ansible/seed-manage-containers.yml diff --git a/ansible/roles/deploy-containers/tasks/main.yml b/ansible/roles/deploy-containers/tasks/main.yml deleted file mode 100644 index bcbde1629..000000000 --- a/ansible/roles/deploy-containers/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include_tasks: "{{ deploy_containers_action }}.yml" diff --git a/ansible/roles/deploy-containers/defaults/main.yml b/ansible/roles/manage-containers/defaults/main.yml similarity index 92% rename from ansible/roles/deploy-containers/defaults/main.yml rename to ansible/roles/manage-containers/defaults/main.yml index 0838be95c..d98bb77df 100644 --- a/ansible/roles/deploy-containers/defaults/main.yml +++ b/ansible/roles/manage-containers/defaults/main.yml @@ -1,6 +1,6 @@ --- # Action to perform: One of: "deploy", "destroy". -deploy_containers_action: "deploy" +manage_containers_action: "deploy" deploy_containers_defaults: comparisons: diff --git a/ansible/roles/deploy-containers/tasks/deploy-container.yml b/ansible/roles/manage-containers/tasks/deploy-container.yml similarity index 100% rename from ansible/roles/deploy-containers/tasks/deploy-container.yml rename to ansible/roles/manage-containers/tasks/deploy-container.yml diff --git a/ansible/roles/deploy-containers/tasks/deploy.yml b/ansible/roles/manage-containers/tasks/deploy.yml similarity index 100% rename from ansible/roles/deploy-containers/tasks/deploy.yml rename to ansible/roles/manage-containers/tasks/deploy.yml diff --git a/ansible/roles/deploy-containers/tasks/destroy-container.yml b/ansible/roles/manage-containers/tasks/destroy-container.yml similarity index 100% rename from ansible/roles/deploy-containers/tasks/destroy-container.yml rename to ansible/roles/manage-containers/tasks/destroy-container.yml diff --git a/ansible/roles/deploy-containers/tasks/destroy.yml b/ansible/roles/manage-containers/tasks/destroy.yml similarity index 100% rename from ansible/roles/deploy-containers/tasks/destroy.yml rename to ansible/roles/manage-containers/tasks/destroy.yml diff --git a/ansible/roles/manage-containers/tasks/main.yml b/ansible/roles/manage-containers/tasks/main.yml new file mode 100644 index 000000000..e1c8de03d --- /dev/null +++ b/ansible/roles/manage-containers/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: "{{ manage_containers_action }}.yml" diff --git a/ansible/seed-deploy-containers.yml b/ansible/seed-deploy-containers.yml deleted file mode 100644 index 585487af8..000000000 --- a/ansible/seed-deploy-containers.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: Ensure defined container images are deployed on seed node - hosts: seed - tags: - - seed-deploy-containers - vars: - deploy_containers_action: "{{ kayobe_action }}" - roles: - - role: deploy-containers diff --git a/ansible/seed-manage-containers.yml b/ansible/seed-manage-containers.yml new file mode 100644 index 000000000..dd81a079b --- /dev/null +++ b/ansible/seed-manage-containers.yml @@ -0,0 +1,10 @@ +--- +- name: "Ensure defined container images are {{ kayobe_action }}ed on seed node" + hosts: seed + tags: + - seed-deploy-containers + - seed-manage-containers + vars: + manage_containers_action: "{{ kayobe_action }}" + roles: + - role: manage-containers diff --git a/doc/source/configuration/reference/seed-custom-containers.rst b/doc/source/configuration/reference/seed-custom-containers.rst index b4f3035ac..a6f094c51 100644 --- a/doc/source/configuration/reference/seed-custom-containers.rst +++ b/doc/source/configuration/reference/seed-custom-containers.rst @@ -74,7 +74,7 @@ module page. List of Kayobe applied defaults to required docker_container variables: -.. literalinclude:: ../../../../ansible/roles/deploy-containers/defaults/main.yml +.. literalinclude:: ../../../../ansible/roles/manage-containers/defaults/main.yml :language: yaml diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index adeed5426..170a5698f 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -729,7 +729,7 @@ class SeedServiceDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, def take_action(self, parsed_args): self.app.LOG.debug("Deploying seed services") playbooks = _build_playbook_list( - "seed-deploy-containers") + "seed-manage-containers") extra_vars = {"kayobe_action": "deploy"} self.run_kayobe_playbooks(parsed_args, playbooks, extra_vars=extra_vars) self.generate_kolla_ansible_config(parsed_args, service_config=False, @@ -766,7 +766,7 @@ class SeedServiceDestroy(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, extra_vars = {"kayobe_action": "destroy"} playbooks = _build_playbook_list( - "seed-deploy-containers", + "seed-manage-containers", "docker-registry") self.run_kayobe_playbooks(parsed_args, playbooks, extra_vars=extra_vars) @@ -798,7 +798,7 @@ class SeedServiceUpgrade(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, def take_action(self, parsed_args): self.app.LOG.debug("Upgrading seed services") playbooks = _build_playbook_list( - "seed-deploy-containers") + "seed-manage-containers") extra_vars = {"kayobe_action": "deploy"} self.run_kayobe_playbooks(parsed_args, playbooks, extra_vars=extra_vars) self.generate_kolla_ansible_config(parsed_args, service_config=False, @@ -1532,7 +1532,7 @@ class OvercloudServiceDeployContainers(KollaAnsibleMixin, KayobeAnsibleMixin, self.run_kolla_ansible_overcloud(parsed_args, "prechecks") # Perform the kolla-ansible deployment. - self.run_kolla_ansible_overcloud(parsed_args, "deploy-containers") + self.run_kolla_ansible_overcloud(parsed_args, "manage-containers") # Deploy kayobe extra services. playbooks = _build_playbook_list("overcloud-extras") diff --git a/kayobe/tests/unit/cli/test_commands.py b/kayobe/tests/unit/cli/test_commands.py index 56c902e9b..6d49a442d 100644 --- a/kayobe/tests/unit/cli/test_commands.py +++ b/kayobe/tests/unit/cli/test_commands.py @@ -809,7 +809,7 @@ class TestCase(unittest.TestCase): expected_calls = [ mock.call( mock.ANY, - [utils.get_data_files_path("ansible", "seed-deploy-containers.yml")], # noqa + [utils.get_data_files_path("ansible", "seed-manage-containers.yml")], # noqa extra_vars={'kayobe_action': 'deploy'} ), mock.call( @@ -863,7 +863,7 @@ class TestCase(unittest.TestCase): expected_calls = [ mock.call( mock.ANY, - [utils.get_data_files_path("ansible", "seed-deploy-containers.yml")], # noqa + [utils.get_data_files_path("ansible", "seed-manage-containers.yml")], # noqa extra_vars={'kayobe_action': 'deploy'} ), mock.call( @@ -1708,7 +1708,7 @@ class TestCase(unittest.TestCase): ), mock.call( mock.ANY, - "deploy-containers", + "manage-containers", ), ] self.assertListEqual(expected_calls, mock_kolla_run.call_args_list)