Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with newer Ansible versions (tested 2.17.5) #411

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions ansible-scylla-manager/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this is how you do it these days, huh?
Interesting...

20 changes: 0 additions & 20 deletions ansible-scylla-manager/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the impression that this manager setup wants the most basic local ScyllaDB setup as possible. Ideally, there shouldn't be much to pass in terms of variables in such a case.

This variable it already happens to be false by default in the scylla-node role. Since it's not doing anything, I removed it.

I.e. I think we should align the scylla-node role to have the most 'basic' defaults as possible. Minimal hassle to get an out-of-the-box working experience.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've placed the variable back, and we can address such variables and defaults in a separate PR.

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"

Expand Down
2 changes: 1 addition & 1 deletion ansible-scylla-node/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions ansible-scylla-node/tasks/manager_agents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the changes that may break things with older Ansible

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only such change AFAICT


when: manager_agent_config_change.changed and start_scylla_service is defined and start_scylla_service|bool
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
vladzcloudius marked this conversation as resolved.
Show resolved Hide resolved
#
# Copyright (C) 2021 ScyllaDB
Expand Down
2 changes: 1 addition & 1 deletion example-playbooks/async_extra/action_plugins/async_kill.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 ScyllaDB
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 ScyllaDB
Expand Down
8 changes: 4 additions & 4 deletions example-playbooks/async_extra/action_plugins/async_task.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 ScyllaDB
Expand Down Expand Up @@ -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())

Expand Down
2 changes: 1 addition & 1 deletion example-playbooks/async_extra/action_plugins/async_wait.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 ScyllaDB
Expand Down
2 changes: 1 addition & 1 deletion example-playbooks/async_extra/library/async_kill.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 ScyllaDB
Expand Down
2 changes: 1 addition & 1 deletion example-playbooks/async_extra/library/async_status_id.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 ScyllaDB
Expand Down
Loading