update salt top to run salt.minion state if defined version not installed. only apply other states if proper version installed

This commit is contained in:
m0duspwnens
2020-07-29 15:52:48 -04:00
parent 22b757f112
commit 3e78c88114

View File

@@ -7,22 +7,30 @@
{%- set FLEETMANAGER = salt['pillar.get']('static:fleet_manager', False) -%} {%- set FLEETMANAGER = salt['pillar.get']('static:fleet_manager', False) -%}
{%- set FLEETNODE = salt['pillar.get']('static:fleet_node', False) -%} {%- set FLEETNODE = salt['pillar.get']('static:fleet_node', False) -%}
{%- set STRELKA = salt['pillar.get']('strelka:enabled', '0') -%} {%- set STRELKA = salt['pillar.get']('strelka:enabled', '0') -%}
{% import_yaml 'salt/minion.defaults.yaml' as salt %}
{% set saltversion = salt.salt.minion.version %}
base: base:
'os:CentOS': 'not G@saltversion:{{saltversion}}':
- match: grain - match: compound
- salt.minion
'G@os:CentOS and G@saltversion:{{saltversion}}':
- match: compound
- yum - yum
- yum.packages - yum.packages
'*': '* and G@saltversion:{{saltversion}}':
- match: compound
- salt - salt
- docker - docker
- patch.os.schedule - patch.os.schedule
- motd - motd
'*_helix': '*_helix and G@saltversion:{{saltversion}}':
- match: compound
- ca - ca
- ssl - ssl
- registry - registry
@@ -39,7 +47,8 @@ base:
- filebeat - filebeat
- schedule - schedule
'*_sensor': '*_sensor and G@saltversion:{{saltversion}}':
- match: compound
- ca - ca
- ssl - ssl
- common - common
@@ -61,7 +70,8 @@ base:
{%- endif %} {%- endif %}
- schedule - schedule
'*_eval': '*_eval and G@saltversion:{{saltversion}}':
- match: compound
- ca - ca
- ssl - ssl
- registry - registry
@@ -117,7 +127,8 @@ base:
{%- endif %} {%- endif %}
'*_manager': '*_manager and G@saltversion:{{saltversion}}':
- match: compound
- ca - ca
- ssl - ssl
- registry - registry
@@ -162,7 +173,8 @@ base:
- domainstats - domainstats
{%- endif %} {%- endif %}
'*_standalone': '*_standalone and G@saltversion:{{saltversion}}':
- match: compound
- ca - ca
- ssl - ssl
- registry - registry
@@ -220,7 +232,7 @@ base:
# Search node logic # Search node logic
'*_node and I@node:node_type:parser': '*_node and I@node:node_type:parser and G@saltversion:{{saltversion}}':
- match: compound - match: compound
- common - common
- firewall - firewall
@@ -230,7 +242,7 @@ base:
{%- endif %} {%- endif %}
- schedule - schedule
'*_node and I@node:node_type:hot': '*_node and I@node:node_type:hot and G@saltversion:{{saltversion}}':
- match: compound - match: compound
- common - common
- firewall - firewall
@@ -241,7 +253,7 @@ base:
{%- endif %} {%- endif %}
- schedule - schedule
'*_node and I@node:node_type:warm': '*_node and I@node:node_type:warm and G@saltversion:{{saltversion}}':
- match: compound - match: compound
- common - common
- firewall - firewall
@@ -251,7 +263,8 @@ base:
{%- endif %} {%- endif %}
- schedule - schedule
'*_searchnode': '*_searchnode and G@saltversion:{{saltversion}}':
- match: compound
- ca - ca
- ssl - ssl
- common - common
@@ -269,7 +282,8 @@ base:
{%- endif %} {%- endif %}
- schedule - schedule
'*_managersensor': '*_managersensor and G@saltversion:{{saltversion}}':
- match: compound
- common - common
- nginx - nginx
- telegraf - telegraf
@@ -283,7 +297,8 @@ base:
{%- endif %} {%- endif %}
- schedule - schedule
'*_managersearch': '*_managersearch and G@saltversion:{{saltversion}}':
- match: compound
- ca - ca
- ssl - ssl
- registry - registry
@@ -329,7 +344,8 @@ base:
- domainstats - domainstats
{%- endif %} {%- endif %}
'*_heavynode': '*_heavynode and G@saltversion:{{saltversion}}':
- match: compound
- ca - ca
- ssl - ssl
- common - common
@@ -353,7 +369,8 @@ base:
- filebeat - filebeat
- schedule - schedule
'*_fleet': '*_fleet and G@saltversion:{{saltversion}}':
- match: compound
- ca - ca
- ssl - ssl
- common - common