From 1f7bcdf32b0c9aeb1d664171b2f68c5115dd4329 Mon Sep 17 00:00:00 2001 From: Vincent Reniers Date: Fri, 11 Oct 2024 14:45:42 +0300 Subject: [PATCH 1/5] ansible/plugin/async: Make use of proper python executable - Per https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/shebang.html: It states that #!/usr/bin/env python should not be used, but rather #!/usr/bin/python. --- example-playbooks/async_extra/action_plugins/async_alias.py | 2 +- example-playbooks/async_extra/action_plugins/async_kill.py | 2 +- example-playbooks/async_extra/action_plugins/async_status_id.py | 2 +- example-playbooks/async_extra/action_plugins/async_task.py | 2 +- example-playbooks/async_extra/action_plugins/async_wait.py | 2 +- example-playbooks/async_extra/library/async_kill.py | 2 +- example-playbooks/async_extra/library/async_status_id.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example-playbooks/async_extra/action_plugins/async_alias.py b/example-playbooks/async_extra/action_plugins/async_alias.py index c391316e..35c03dcc 100644 --- a/example-playbooks/async_extra/action_plugins/async_alias.py +++ b/example-playbooks/async_extra/action_plugins/async_alias.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2021 ScyllaDB diff --git a/example-playbooks/async_extra/action_plugins/async_kill.py b/example-playbooks/async_extra/action_plugins/async_kill.py index 28cbd314..8a862df2 100644 --- a/example-playbooks/async_extra/action_plugins/async_kill.py +++ b/example-playbooks/async_extra/action_plugins/async_kill.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2021 ScyllaDB diff --git a/example-playbooks/async_extra/action_plugins/async_status_id.py b/example-playbooks/async_extra/action_plugins/async_status_id.py index a9ac635a..2dc7c98d 100644 --- a/example-playbooks/async_extra/action_plugins/async_status_id.py +++ b/example-playbooks/async_extra/action_plugins/async_status_id.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2021 ScyllaDB diff --git a/example-playbooks/async_extra/action_plugins/async_task.py b/example-playbooks/async_extra/action_plugins/async_task.py index 5a604902..d1393ceb 100644 --- a/example-playbooks/async_extra/action_plugins/async_task.py +++ b/example-playbooks/async_extra/action_plugins/async_task.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2021 ScyllaDB diff --git a/example-playbooks/async_extra/action_plugins/async_wait.py b/example-playbooks/async_extra/action_plugins/async_wait.py index 3513ff4c..58aff971 100644 --- a/example-playbooks/async_extra/action_plugins/async_wait.py +++ b/example-playbooks/async_extra/action_plugins/async_wait.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2021 ScyllaDB diff --git a/example-playbooks/async_extra/library/async_kill.py b/example-playbooks/async_extra/library/async_kill.py index 52f3a168..53563a39 100644 --- a/example-playbooks/async_extra/library/async_kill.py +++ b/example-playbooks/async_extra/library/async_kill.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2021 ScyllaDB diff --git a/example-playbooks/async_extra/library/async_status_id.py b/example-playbooks/async_extra/library/async_status_id.py index aab9e6d1..76ccb3d2 100644 --- a/example-playbooks/async_extra/library/async_status_id.py +++ b/example-playbooks/async_extra/library/async_status_id.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (C) 2021 ScyllaDB From 2254cff28b1cbac351bd4fa9f8dfa9c08c286724 Mon Sep 17 00:00:00 2001 From: Vincent Reniers Date: Fri, 11 Oct 2024 14:47:55 +0300 Subject: [PATCH 2/5] ansible/plugin/async_task: Support with Ansible 2.14 These handler class variables were removed, and instead became options that can be set. --- example-playbooks/async_extra/action_plugins/async_task.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example-playbooks/async_extra/action_plugins/async_task.py b/example-playbooks/async_extra/action_plugins/async_task.py index d1393ceb..796d7dbe 100644 --- a/example-playbooks/async_extra/action_plugins/async_task.py +++ b/example-playbooks/async_extra/action_plugins/async_task.py @@ -374,9 +374,9 @@ def wait_async_task(self, alias, cleanup, retries, delay, vars): def v2_on_result(self, host, task, result): handler = self._shared_loader_obj.callback_loader.get('default') handler._display = self._display - handler.display_ok_hosts = True - handler.display_failed_stderr = True - handler.display_skipped_hosts = True + handler.set_option('display_ok_hosts', True) + handler.set_option('display_failed_stderr', True) + handler.set_option('display_skipped_hosts', True) payload = TaskResult(host=host, task=task, return_data=result, task_fields=self._task.dump_attrs()) From 1a5600a60d96e3f85957e7a42daa6d03cda84c01 Mon Sep 17 00:00:00 2001 From: Vincent Reniers Date: Fri, 11 Oct 2024 14:52:29 +0300 Subject: [PATCH 3/5] ansible-scylla-node: common.yml: Avoid deactivating services that don't exist. Bug fix: A service that is defined in ansible facts, is no guarantee for its existence. A service such as "firewalld" may appear, but it could have a status as 'not-found'. --- ansible-scylla-node/tasks/common.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-scylla-node/tasks/common.yml b/ansible-scylla-node/tasks/common.yml index 1048f831..d57de3cb 100644 --- a/ansible-scylla-node/tasks/common.yml +++ b/ansible-scylla-node/tasks/common.yml @@ -11,7 +11,7 @@ - firewalld.service - iptables_services.service - ufw.service - when: ansible_facts.services[item] is defined + when: ansible_facts.services[item] is defined and ansible_facts.services[item]['status'] != 'not-found' - name: Flush all iptables rules iptables: flush: yes From db2245609611cc66cb6027e9ab4258190fa11535 Mon Sep 17 00:00:00 2001 From: Vincent Reniers Date: Fri, 11 Oct 2024 14:53:55 +0300 Subject: [PATCH 4/5] ansible-scylla-manager: manager_agents.yml: Remove ignore_errors when starting the manager. Errors should not be ignored when the manager service cannot start. --- ansible-scylla-node/tasks/manager_agents.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ansible-scylla-node/tasks/manager_agents.yml b/ansible-scylla-node/tasks/manager_agents.yml index e66567f7..1be20366 100644 --- a/ansible-scylla-node/tasks/manager_agents.yml +++ b/ansible-scylla-node/tasks/manager_agents.yml @@ -60,8 +60,4 @@ state: restarted enabled: yes become: true - when: manager_agent_config_change.changed and start_scylla_service is defined and start_scylla_service|bool - ignore_errors: true - #TODO: remove ignore_errors when ansible is bumped to 2.10.4 or 2.9.16 as per https://github.com/ansible/ansible/issues/71528 - - + when: manager_agent_config_change.changed and start_scylla_service is defined and start_scylla_service|bool \ No newline at end of file From f7aec209428602eb47a1e104d6891e22b821e6c2 Mon Sep 17 00:00:00 2001 From: Vincent Reniers Date: Mon, 21 Oct 2024 15:26:25 +0300 Subject: [PATCH 5/5] ansible-scylla-manager: Dependency with ansible-scylla-node fix Newer ansible versions change the behavior regarding dependencies. Variables were not properly passed, such as the desired scylla_version, which ended up using ansible-scylla-node defaults such as a scylla_version of '0.0.0'. This removes the now redundant import role in common.yml and properly specifies the dependency along with its variables. Signed-off-by: Vincent Reniers --- ansible-scylla-manager/meta/main.yml | 19 ++++++++++++++++--- ansible-scylla-manager/tasks/main.yml | 20 -------------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/ansible-scylla-manager/meta/main.yml b/ansible-scylla-manager/meta/main.yml index 7a218cd3..80e1e502 100644 --- a/ansible-scylla-manager/meta/main.yml +++ b/ansible-scylla-manager/meta/main.yml @@ -24,6 +24,19 @@ galaxy_info: - scylla - scylla-manager -dependencies: - - ansible-scylla-node - +dependencies: + - role: "ansible-scylla-node" + vars: + scylla_version: 'latest' + install_only: true + scylla_manager_enabled: false + scylla_edition: "{{ scylla_manager_db_vars.scylla_edition|default('oss') }}" + elrepo_kernel: false + scylla_repo_keyserver: "{{ scylla_manager_db_vars.scylla_repo_keyserver|default('') }}" + scylla_repo_keys: "{{ scylla_manager_db_vars.scylla_repo_keys|default([]) }}" + scylla_dependencies: "{{ scylla_manager_db_vars.scylla_dependencies|default([]) }}" + scylla_ssl: + internode: + enabled: false + client: + enabled: false diff --git a/ansible-scylla-manager/tasks/main.yml b/ansible-scylla-manager/tasks/main.yml index e3ae947d..f124e090 100644 --- a/ansible-scylla-manager/tasks/main.yml +++ b/ansible-scylla-manager/tasks/main.yml @@ -1,24 +1,4 @@ --- -- name: deploy local Scylla on the Manager node - import_role: - name: "{{ role_path }}/../ansible-scylla-node" - vars: - # TODO how to use scylla_manager_db_vars to be passed on as role params? - install_only: True - scylla_manager_enabled: false - scylla_version: 'latest' - scylla_edition: "{{ scylla_manager_db_vars.scylla_edition|default('oss') }}" - elrepo_kernel: false - scylla_repo_keyserver: "{{ scylla_manager_db_vars.scylla_repo_keyserver|default('') }}" - scylla_repo_keys: "{{ scylla_manager_db_vars.scylla_repo_keys|default([]) }}" - scylla_dependencies: "{{ scylla_manager_db_vars.scylla_dependencies|default([]) }}" - scylla_ssl: - internode: - enabled: false - client: - enabled: false - - - name: install Scylla Manager include_tasks: "{{ ansible_os_family }}.yml"