From e9b12632495db01340aff639fb8f1ff01526f8e1 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 2 May 2024 16:32:43 -0400 Subject: [PATCH] orchestate searchnode deployment --- salt/manager/tools/sbin/so-minion | 11 +++++++---- salt/orch/deploy_searchnode.sls | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 salt/orch/deploy_searchnode.sls diff --git a/salt/manager/tools/sbin/so-minion b/salt/manager/tools/sbin/so-minion index 34e069ece..8a34ddca0 100755 --- a/salt/manager/tools/sbin/so-minion +++ b/salt/manager/tools/sbin/so-minion @@ -613,11 +613,14 @@ function updateMineAndApplyStates() { if [[ "$NODETYPE" == "SEARCHNODE" || "$NODETYPE" == "HEAVYNODE" ]]; then # calls so-common and set_minionid sets MINIONID to local minion id set_minionid - salt $MINIONID state.apply elasticsearch queue=True --async - salt $MINIONID state.apply soc queue=True --async + #salt $MINIONID state.apply elasticsearch queue=True --async + # salt $MINIONID state.apply soc queue=True --async + # $MINIONID is the minion id of the manager and $MINION_ID is the target node or the node being configured + salt-run state.orch orch.deploy_searchnode pillar="{'setup': {'manager': $MINIONID, 'searchnode': $MINION_ID }}" + else + # run this async so the cli doesn't wait for a return + salt "$MINION_ID" state.highstate --async queue=True fi - # run this async so the cli doesn't wait for a return - salt "$MINION_ID" state.highstate --async queue=True } function setupMinionFiles() { diff --git a/salt/orch/deploy_searchnode.sls b/salt/orch/deploy_searchnode.sls new file mode 100644 index 000000000..a70e7bdbf --- /dev/null +++ b/salt/orch/deploy_searchnode.sls @@ -0,0 +1,16 @@ +{% set MANAGER = salt['pillar.get']('setup:manager') %} +{% set SEARCHNODE = salt['pillar.get']('setup:searchnode') %} + +manager_run_es_soc: + salt.state: + - tgt: {{ MANAGER }} + - sls: + - elasticsearch + - soc + +searchnode_run_highstate: + salt.state: + - tgt: {{ TARGET }} + - highstate: True + - require: + - salt: manager_run_es_soc