mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
apply holds to salt each state run
This commit is contained in:
@@ -3,12 +3,10 @@
|
||||
|
||||
{% if grains.os_family == 'Debian' %}
|
||||
{% set SPLITCHAR = '+' %}
|
||||
{% set SALTNOTHELD = salt['cmd.run']('apt-mark showhold | grep -q salt ; echo $?', python_shell=True) %}
|
||||
{% set SALTPACKAGES = ['salt-common', 'salt-master', 'salt-minion'] %}
|
||||
{% set SYSTEMD_UNIT_FILE = '/lib/systemd/system/salt-minion.service' %}
|
||||
{% else %}
|
||||
{% set SPLITCHAR = '-' %}
|
||||
{% set SALTNOTHELD = salt['cmd.run']('yum versionlock list | grep -q salt ; echo $?', python_shell=True) %}
|
||||
{% set SALTPACKAGES = ['salt', 'salt-master', 'salt-minion'] %}
|
||||
{% set SYSTEMD_UNIT_FILE = '/usr/lib/systemd/system/salt-minion.service' %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
{% from 'salt/map.jinja' import SALTNOTHELD %}
|
||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls in allowed_states %}
|
||||
|
||||
include:
|
||||
- salt.minion
|
||||
|
||||
{% if SALTNOTHELD == 1 %}
|
||||
hold_salt_master_package:
|
||||
module.run:
|
||||
- pkg.hold:
|
||||
- name: salt-master
|
||||
{% endif %}
|
||||
|
||||
# prior to 2.4.30 this engine ran on the manager with salt-minion
|
||||
# this has changed to running with the salt-master in 2.4.30
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
{% from 'salt/map.jinja' import UPGRADECOMMAND with context %}
|
||||
{% from 'salt/map.jinja' import SALTVERSION %}
|
||||
{% from 'salt/map.jinja' import INSTALLEDSALTVERSION %}
|
||||
{% from 'salt/map.jinja' import SALTNOTHELD %}
|
||||
{% from 'salt/map.jinja' import SALTPACKAGES %}
|
||||
{% from 'salt/map.jinja' import SYSTEMD_UNIT_FILE %}
|
||||
{% import_yaml 'salt/minion.defaults.yaml' as SALTMINION %}
|
||||
@@ -20,15 +19,12 @@ include:
|
||||
|
||||
{% if INSTALLEDSALTVERSION|string != SALTVERSION|string %}
|
||||
|
||||
{% if SALTNOTHELD | int == 0 %}
|
||||
unhold_salt_packages:
|
||||
module.run:
|
||||
- pkg.unhold:
|
||||
- pkgs:
|
||||
pkg.unheld:
|
||||
- pkgs:
|
||||
{% for package in SALTPACKAGES %}
|
||||
- {{ package }}
|
||||
- {{ package }}-0:{{INSTALLEDSALTVERSION}}-0.*
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
install_salt_minion:
|
||||
cmd.run:
|
||||
@@ -42,15 +38,12 @@ install_salt_minion:
|
||||
|
||||
{% if INSTALLEDSALTVERSION|string == SALTVERSION|string %}
|
||||
|
||||
{% if SALTNOTHELD | int == 1 %}
|
||||
hold_salt_packages:
|
||||
module.run:
|
||||
- pkg.hold:
|
||||
- pkgs:
|
||||
pkg.held:
|
||||
- pkgs:
|
||||
{% for package in SALTPACKAGES %}
|
||||
- {{ package }}
|
||||
- {{ package }}-0:{{SALTVERSION}}-0.*
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
remove_error_log_level_logfile:
|
||||
file.line:
|
||||
|
||||
Reference in New Issue
Block a user