mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
only add node to pillar if returned ip from mine
This commit is contained in:
@@ -7,19 +7,23 @@
|
|||||||
tgt_type='compound') | dictsort()
|
tgt_type='compound') | dictsort()
|
||||||
%}
|
%}
|
||||||
|
|
||||||
{% set hostname = cached_grains[minionid]['host'] %}
|
# only add a node to the pillar if it returned an ip from the mine
|
||||||
{% set node_type = minionid.split('_')[1] %}
|
{% if ip[0] | length > 0%}
|
||||||
{% if node_type not in node_types.keys() %}
|
{% set hostname = cached_grains[minionid]['host'] %}
|
||||||
{% do node_types.update({node_type: {hostname: ip[0]}}) %}
|
{% set node_type = minionid.split('_')[1] %}
|
||||||
{% else %}
|
{% if node_type not in node_types.keys() %}
|
||||||
{% if hostname not in node_types[node_type] %}
|
{% do node_types.update({node_type: {hostname: ip[0]}}) %}
|
||||||
{% do node_types[node_type].update({hostname: ip[0]}) %}
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% do node_types[node_type][hostname].update(ip[0]) %}
|
{% if hostname not in node_types[node_type] %}
|
||||||
|
{% do node_types[node_type].update({hostname: ip[0]}) %}
|
||||||
|
{% else %}
|
||||||
|
{% 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,18 +4,22 @@
|
|||||||
{% 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 %}
|
||||||
{% if minionid in manage_alived.keys() %}
|
|
||||||
{% if ip[0] == manage_alived[minionid] %}
|
# only add a node to the pillar if it returned an ip from the mine
|
||||||
{% set is_alive = True %}
|
{% if ip | length > 0%}
|
||||||
|
{% if minionid in manage_alived.keys() %}
|
||||||
|
{% if ip[0] == manage_alived[minionid] %}
|
||||||
|
{% set is_alive = True %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% if node_type not in node_types.keys() %}
|
||||||
{% if node_type not in node_types.keys() %}
|
{% do node_types.update({node_type: {hostname: {'ip':ip[0], 'alive':is_alive }}}) %}
|
||||||
{% do node_types.update({node_type: {hostname: {'ip':ip[0], 'alive':is_alive }}}) %}
|
|
||||||
{% else %}
|
|
||||||
{% if hostname not in node_types[node_type] %}
|
|
||||||
{% do node_types[node_type].update({hostname: {'ip':ip[0], 'alive':is_alive}}) %}
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% do node_types[node_type][hostname].update({'ip':ip[0], 'alive':is_alive}) %}
|
{% if hostname not in node_types[node_type] %}
|
||||||
|
{% do node_types[node_type].update({hostname: {'ip':ip[0], 'alive':is_alive}}) %}
|
||||||
|
{% else %}
|
||||||
|
{% do node_types[node_type][hostname].update({'ip':ip[0], 'alive':is_alive}) %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
0
pillar/nodegroups/init.sls
Normal file
0
pillar/nodegroups/init.sls
Normal file
Reference in New Issue
Block a user