update all nodes motd with nodes that need restarted from patch updates - https://github.com/Security-Onion-Solutions/securityonion-saltstack/issues/112

This commit is contained in:
m0duspwnens
2019-11-15 13:58:32 -05:00
parent b2b75acedb
commit ff4077a46f
6 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
{% set needs_restarting_check = salt['mine.get']('*', 'needs_restarting.check', tgt_type='glob') -%}
{%- if needs_restarting_check %}
{%- set minions_need_restarted = [] %}
{%- for minion, need_restarted in needs_restarting_check | dictsort() %}
{%- if need_restarted == 'True' %}
{% do minions_need_restarted.append(minion) %}
{%- endif %}
{%- endfor -%}
{%- if minions_need_restarted | length > 0 %}
*****************************************************************************************
* The following nodes in your Security Onion grid need restarted due to package updates *
*****************************************************************************************
{% for minion in minions_need_restarted -%}
{{ minion }}
{% endfor -%}
{%- endif -%}
{%- endif -%}

5
salt/motd/init.sls Normal file
View File

@@ -0,0 +1,5 @@
package_update_reboot_required_motd:
file.append:
- name: /etc/motd
- source: salt://motd/files/package_update_reboot_required.jinja
- template: jinja