Skip to content
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
4 changes: 4 additions & 0 deletions ansible-scylla-node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ cleanup_timeout_seconds: 36000
# this should be set to false
start_scylla_service: true

# Let operation playbooks suppress automatic service startup even when reused
# deployment parameters set start_scylla_service to true.
skip_start_scylla_service: false
Comment thread
ManjotS marked this conversation as resolved.

# Only relevant for Debian/Ubuntu
scylla_repo_keyserver: 'hkp://keyserver.ubuntu.com:80'
scylla_repo_keys:
Expand Down
16 changes: 11 additions & 5 deletions ansible-scylla-node/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@
line: ""
become: true
when: token_distributor is defined
when: start_scylla_service is defined and start_scylla_service|bool
when:
- start_scylla_service is defined and start_scylla_service|bool
- not skip_start_scylla_service|bool

- name: Copy system and table keys
include_tasks: copy_system_and_table_keys.yml
Expand Down Expand Up @@ -424,7 +426,8 @@
_keyspace_replication_strategy: "{{ system_auth_replication_strategy }}"
_keyspace_rf: "{{ system_auth_rf }}"
when:
- start_scylla_service|bool
- start_scylla_service is defined and start_scylla_service|bool
- not skip_start_scylla_service|bool
- adjust_system_auth_replication is defined and adjust_system_auth_replication|bool
- _authentication_enabled is defined and _authentication_enabled|bool
- system_auth_rf is defined and system_auth_replication_strategy is defined
Expand All @@ -436,7 +439,8 @@
_keyspace_replication_strategy: "{{ audit_replication_strategy }}"
_keyspace_rf: "{{ audit_rf }}"
when:
- start_scylla_service|bool
- start_scylla_service is defined and start_scylla_service|bool
- not skip_start_scylla_service|bool
- adjust_audit_replication is defined and adjust_audit_replication|bool
- _audit_enabled is defined and _audit_enabled|bool
- audit_rf is defined and audit_replication_strategy is defined
Expand All @@ -448,7 +452,8 @@
_keyspace_replication_strategy: "{{ system_distributed_replication_strategy }}"
_keyspace_rf: "{{ system_distributed_rf }}"
when:
- start_scylla_service|bool
- start_scylla_service is defined and start_scylla_service|bool
- not skip_start_scylla_service|bool
- adjust_system_distributed_replication is defined and adjust_system_distributed_replication|bool
- system_distributed_rf is defined and system_distributed_replication_strategy is defined

Expand All @@ -459,7 +464,8 @@
_keyspace_replication_strategy: "{{ system_traces_replication_strategy }}"
_keyspace_rf: "{{ system_traces_rf }}"
when:
- start_scylla_service|bool
- start_scylla_service is defined and start_scylla_service|bool
- not skip_start_scylla_service|bool
- adjust_system_traces_replication is defined and adjust_system_traces_replication|bool
- system_traces_rf is defined and system_traces_replication_strategy is defined

Expand Down
5 changes: 4 additions & 1 deletion ansible-scylla-node/tasks/manager_agents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,7 @@
state: restarted
enabled: yes
become: true
when: manager_agent_config_change.changed and start_scylla_service is defined and start_scylla_service|bool
when:
- manager_agent_config_change.changed
- start_scylla_service is defined and start_scylla_service|bool
- not skip_start_scylla_service|bool
3 changes: 2 additions & 1 deletion example-playbooks/replace_node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ This playbook will run the replace dead node procedure.
* A scylla cluster with scylla-manager and scylla-monitoring installed.
* The inventory file must be updated as described in the Usage section below, ie.: The new node should replace the dead node in the inventory.
* It's necessary to have files with the same parameters used when the cluster was created, as described in the Parameters section.
* It's very important to have `start_scylla_service` set to `false`. The replace will not work otherwise.

## Usage:

Expand Down Expand Up @@ -50,6 +49,8 @@ This playbook uses the node role to install and configure Scylla in the new node
and use Scylla Manager to issue a repair if needed.
So the same parameters for all three roles (node, monitoring and manager) that were
used when the cluster was created should also be passed to the `replace_node.yml` playbook.
The playbook suppresses automatic Scylla startup while applying the node role, regardless of the
`start_scylla_service` value in those reused parameters.
See the `Usage` section of this README for the way how these parameters are supposed to be passed.

Besides the vars from the node role, this playbook has the following mandatory parameters: `replaced_node`, `replaced_node_broadcast_address` and `new_node`.
Expand Down
4 changes: 3 additions & 1 deletion example-playbooks/replace_node/replace_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@
vars:
disable_firewall: false
roles:
- ansible-scylla-node
- role: ansible-scylla-node
vars:
skip_start_scylla_service: true


- name: Update scylla-monitoring
Expand Down
6 changes: 0 additions & 6 deletions example-playbooks/replace_node/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
# scylla_seeds:
# - "{{ groups['scylla'][0] }}"

# This should always be set to False, since it'll be passed to the node role
# and we don't want the node role to start the new node automatically.
# If you're reusing (as expected) the parameters you used to deploy the other nodes,
# make sure that you set this specific value to false
start_scylla_service: false

# By default, the playbook will repair the new node only if RBNO was not used
# during the replacement.
# If you set this to true, the repair will be skipped even in such case.
Expand Down
Loading