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