diff --git a/salt/mine/update.sls b/salt/mine/update.sls deleted file mode 100644 index 03ea76c9e..000000000 --- a/salt/mine/update.sls +++ /dev/null @@ -1,24 +0,0 @@ -# This state sends an event to the salt-master event bus -# The event will be caught by the reactor and trigger the mine_update orchestration - -{# may be able to use this method if we can figure out multi state run failure - https://github.com/saltstack/salt/issues/66929 #} -# Get the minion ID from the pillar -{% set MINION_ID = grains.id %} - -# Run mine.update on all minions -mine.update.update_mine_all_minions: - salt.function: - - name: mine.update - - tgt: '*' - - batch: 50 - - retry: - attempts: 3 - interval: 1 - -# Run highstate on the original minion -# we can use concurrent on this highstate because no other highstate would be running when this is called -mine.update.run_highstate_on_{{ MINION_ID }}: - salt.state: - - tgt: {{ MINION_ID }} - - highstate: True - - concurrent: True diff --git a/salt/salt/master/mine_update_highstate.sls b/salt/salt/master/mine_update_highstate.sls new file mode 100644 index 000000000..874e6c65b --- /dev/null +++ b/salt/salt/master/mine_update_highstate.sls @@ -0,0 +1,26 @@ +# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one +# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at +# https://securityonion.net/license; you may not use this file except in compliance with the +# Elastic License 2.0. + +# This state should only be run on managers and should never be run manually + +{% set MINION_ID = grains.id %} + +# Run mine.update on all minions +salt.master.mine_update_highstate.update_mine_all_minions: + salt.function: + - name: mine.update + - tgt: '*' + - batch: 50 + - retry: + attempts: 3 + interval: 1 + +# Run highstate on the original minion +# we can use concurrent on this highstate because no other highstate would be running when this is called +salt.master.mine_update_highstate.run_highstate_on_{{ MINION_ID }}: + salt.state: + - tgt: {{ MINION_ID }} + - highstate: True + - concurrent: True diff --git a/salt/top.sls b/salt/top.sls index 4a6e8e010..ee364b81b 100644 --- a/salt/top.sls +++ b/salt/top.sls @@ -20,7 +20,7 @@ base: 'I@node_data:False and ( *_manager* or *_eval or *_import or *_standalone )': - match: compound - salt.minion - - mine.update + - salt.master.mine_update_highstate 'not G@saltversion:{{saltversion}} and not I@node_data:False': - match: compound