mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-02-20 14:05:26 +01:00
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:
23
salt/motd/files/package_update_reboot_required.jinja
Normal file
23
salt/motd/files/package_update_reboot_required.jinja
Normal 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
5
salt/motd/init.sls
Normal 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
|
||||
Reference in New Issue
Block a user