mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 01:32:47 +01:00
only add node to pillar if returned ip from mine
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
tgt_type='compound') | dictsort()
|
tgt_type='compound') | dictsort()
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
# only add a node to the pillar if it returned an ip from the mine
|
||||||
|
{% if ip[0] | length > 0%}
|
||||||
{% set hostname = cached_grains[minionid]['host'] %}
|
{% set hostname = cached_grains[minionid]['host'] %}
|
||||||
{% set node_type = minionid.split('_')[1] %}
|
{% set node_type = minionid.split('_')[1] %}
|
||||||
{% if node_type not in node_types.keys() %}
|
{% if node_type not in node_types.keys() %}
|
||||||
@@ -18,8 +20,10 @@
|
|||||||
{% do node_types[node_type][hostname].update(ip[0]) %}
|
{% do node_types[node_type][hostname].update(ip[0]) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% fi %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
logstash:
|
logstash:
|
||||||
nodes:
|
nodes:
|
||||||
{% for node_type, values in node_types.items() %}
|
{% for node_type, values in node_types.items() %}
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
{% set hostname = minionid.split('_')[0] %}
|
{% set hostname = minionid.split('_')[0] %}
|
||||||
{% set node_type = minionid.split('_')[1] %}
|
{% set node_type = minionid.split('_')[1] %}
|
||||||
{% set is_alive = False %}
|
{% set is_alive = False %}
|
||||||
|
|
||||||
|
# only add a node to the pillar if it returned an ip from the mine
|
||||||
|
{% if ip | length > 0%}
|
||||||
{% if minionid in manage_alived.keys() %}
|
{% if minionid in manage_alived.keys() %}
|
||||||
{% if ip[0] == manage_alived[minionid] %}
|
{% if ip[0] == manage_alived[minionid] %}
|
||||||
{% set is_alive = True %}
|
{% set is_alive = True %}
|
||||||
@@ -18,6 +21,7 @@
|
|||||||
{% do node_types[node_type][hostname].update({'ip':ip[0], 'alive':is_alive}) %}
|
{% do node_types[node_type][hostname].update({'ip':ip[0], 'alive':is_alive}) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
node_data:
|
node_data:
|
||||||
|
|||||||
0
pillar/nodegroups/init.sls
Normal file
0
pillar/nodegroups/init.sls
Normal file
Reference in New Issue
Block a user