Skip to content

Commit 7641b06

Browse files
author
Eddie Satterly
authored
Merge pull request #2 from tjmcs/tb/skip-existing-nodes
Adds code to check for existing nodes and skip unless flag is set
2 parents 5accfe8 + f6378a8 commit 7641b06

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

provision-solr.yml

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
- set_fact:
3939
num_solr_nodes: "{{groups['solr'] | default([]) | length}}"
4040
num_zk_nodes: "{{groups['zookeeper'] | default([]) | length}}"
41+
# if an existing set of Solr/Fusion nodes were found, throw an error
42+
# unless the reuse_existing_nodes flag was set to 'true' or 'yes')
43+
- block:
44+
- name: Fail playbook run if existing nodes found and user did not request reuse
45+
fail:
46+
msg: "Found an existing set of nodes - {{(groups['solr'] | to_yaml).split('\n').0}}; aborting playbook run"
47+
when: not((reuse_existing_nodes | default(false)) | bool)
48+
when: num_solr_nodes | int > 0
4149
# if an external Zookeeper ensemble (or node) was not found and we're
4250
# deploying an Solr/Fusion cluster (or multiple matching Solr/Fusion
4351
# nodes were found), then it's an error

0 commit comments

Comments
 (0)