diff --git a/salt/mine/update.sls b/salt/mine/update.sls index 59e137d2b..d7cdd18d0 100644 --- a/salt/mine/update.sls +++ b/salt/mine/update.sls @@ -1,7 +1,26 @@ # 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 -send_mine_update_event: - module.run: - - name: event.send - - tag: salt/minion/{{grains.id}}/mine_update +{# 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 + - require: + - salt: mine.update.update_mine_all_minions diff --git a/salt/orch/mine_update.sls b/salt/orch/mine_update.sls deleted file mode 100644 index 1483c1225..000000000 --- a/salt/orch/mine_update.sls +++ /dev/null @@ -1,21 +0,0 @@ -# Get the minion ID from the pillar -{% set MINION_ID = salt['pillar.get']('minion_id') %} - -# Run mine.update on all minions -update_mine_all_minions: - salt.function: - - name: mine.update - - tgt: '*' - - batch: 50 - - retry: - attempts: 3 - interval: 1 - -# Run highstate on the original minion -run_highstate_on_original_minion: - salt.state: - - tgt: {{ MINION_ID }} - - highstate: True - - queue: True - - require: - - salt: update_mine_all_minions diff --git a/salt/reactor/mine_update.sls b/salt/reactor/mine_update.sls deleted file mode 100644 index 968987cec..000000000 --- a/salt/reactor/mine_update.sls +++ /dev/null @@ -1,8 +0,0 @@ -# This reactor triggers the mine_update orchestration when it receives a mine_update event - -trigger_mine_update_orchestration: - runner.state.orchestrate: - - args: - - mods: orch.mine_update - - pillar: - minion_id: {{ data['id'] }} diff --git a/salt/salt/master.sls b/salt/salt/master.sls index ddfb9c3e7..cf9f4718c 100644 --- a/salt/salt/master.sls +++ b/salt/salt/master.sls @@ -3,7 +3,6 @@ include: - salt.minion - - salt.master.reactor_config_mine_update hold_salt_master_package: module.run: diff --git a/salt/salt/master/reactor_config_mine_update.sls b/salt/salt/master/reactor_config_mine_update.sls deleted file mode 100644 index deffbf58d..000000000 --- a/salt/salt/master/reactor_config_mine_update.sls +++ /dev/null @@ -1,13 +0,0 @@ -reactor_config_hypervisor: - file.managed: - - name: /etc/salt/master.d/reactor_mine_update.conf - - contents: | - reactor: - - 'salt/minion/*/mine_update': - - salt://reactor/mine_update.sls - - group: root - - mode: 644 - - makedirs: True - - watch_in: - - service: salt_master_service - - order: last diff --git a/salt/top.sls b/salt/top.sls index d33b23932..4a6e8e010 100644 --- a/salt/top.sls +++ b/salt/top.sls @@ -17,12 +17,17 @@ base: - schedule - logrotate - 'not G@saltversion:{{saltversion}}': + 'I@node_data:False and ( *_manager* or *_eval or *_import or *_standalone )': + - match: compound + - salt.minion + - mine.update + + 'not G@saltversion:{{saltversion}} and not I@node_data:False': - match: compound - salt.minion-state-apply-test - salt.minion - '* and G@saltversion:{{saltversion}}': + '* and G@saltversion:{{saltversion}} and not I@node_data:False': - match: compound - salt.minion - patch.os.schedule @@ -33,10 +38,6 @@ base: - docker - docker_clean - '*_manager* or *_standalone or *_eval or *_import and I@node_data:False': - - match: compound - - mine.update - '*_eval and G@saltversion:{{saltversion}} and not I@node_data:False': - match: compound - salt.master