Skip to content

Commit 38b66d0

Browse files
vrenierscursoragent
andcommitted
ansible-scylla-node: fail fast when scylla_seeds is unset
Removing the implicit scylla_seeds default meant the role would only surface an undefined-variable error deep into common.yml. Add an early explicit check so misconfiguration fails fast with a clear message instead. Also fix the commented example to use consistent groups['scylla'][0] bracket indexing and drop trailing whitespace. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2c42dde commit 38b66d0

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

ansible-scylla-node/defaults/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,13 @@ io_conf: 'SEASTAR_IO="--io-properties-file /etc/scylla.d/io_properties.yaml"'
296296
# scylla_args_value: "--log-to-syslog 1 --log-to-stdout 0 --default-log-level info --network-stack posix"
297297

298298
# Seeds node list (mandatory parameter)
299-
# A seed should be either a DNS resolvable address (e.g. hostname) that is resolvable by all nodes in the cluster,
299+
# A seed should be either a DNS resolvable address (e.g. hostname) that is resolvable by all nodes in the cluster,
300300
# or an IP address that is accessible by all nodes in the cluster.
301301
# If the hostname is not resolvable by all nodes, then such an IP address can be set, for example, explicitly or via ansible_host.
302302
# Do not use the below default example if ansible_host is not specified and the hostname is not resolvable by all nodes.
303303
#
304304
#scylla_seeds:
305-
# - "{{ hostvars[groups.scylla.0].ansible_host if 'ansible_host' in hostvars[groups.scylla.0] else groups.scylla.0 }}"
305+
# - "{{ hostvars[groups['scylla'][0]].ansible_host if 'ansible_host' in hostvars[groups['scylla'][0]] else groups['scylla'][0] }}"
306306

307307
scylla_listen_address: "{{ vars['ansible_'~scylla_nic].ipv4.address }}"
308308
scylla_rpc_address: "{{ vars['ansible_'~scylla_nic].ipv4.address }}"

ansible-scylla-node/tasks/common.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
---
2+
3+
# Sanity check: scylla_seeds has no default and is mandatory since there is no
4+
# hostname/IP that can be safely assumed reachable by all nodes in the cluster.
5+
- name: "Sanity check: scylla_seeds must be explicitly defined"
6+
fail:
7+
msg: >-
8+
scylla_seeds is not defined or empty. Set it explicitly, e.g. to a DNS resolvable
9+
hostname reachable by all nodes, or an IP address (possibly via ansible_host).
10+
See defaults/main.yml for an example.
11+
when: scylla_seeds is not defined or scylla_seeds | length == 0
12+
213
- name: General, NIC and CPU settings related tweaking
314
block:
415
- name: configure Scylla

0 commit comments

Comments
 (0)