mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
set interface for hypervisor/managerhype
This commit is contained in:
@@ -3,6 +3,13 @@
|
||||
https://securityonion.net/license; you may not use this file except in compliance with the
|
||||
Elastic License 2.0. #}
|
||||
|
||||
{% set role = salt['grains.get']('role', '') %}
|
||||
{% if role in ['so-hypervisor','so-managerhype'] and salt['network.ip_addrs']('br0')|length > 0 %}
|
||||
{% set interface = 'br0' %}
|
||||
{% else %}
|
||||
{% set interface = pillar.host.mainint %}
|
||||
{% endif %}
|
||||
|
||||
{% import_yaml 'salt/minion.defaults.yaml' as saltminion %}
|
||||
{% set SALTVERSION = saltminion.salt.minion.version | string %}
|
||||
{% set INSTALLEDSALTVERSION = grains.saltversion | string %}
|
||||
|
||||
@@ -7,12 +7,8 @@
|
||||
# GLOBALS are imported in the salt.minion state and that is not available at that point in setup
|
||||
# this state is included in the salt.minion state
|
||||
|
||||
{% set role = salt['grains.get']('role', '') %}
|
||||
{% if role in ['so-hypervisor','so-managerhype'] and salt['network.ip_addrs']('br0')|length > 0 %}
|
||||
{% set interface = 'br0' %}
|
||||
{% else %}
|
||||
{% set interface = pillar.host.mainint %}
|
||||
{% endif %}
|
||||
{% from 'salt/map.jinja' import interface %}
|
||||
{% from 'salt/map.jinja' import role %}
|
||||
|
||||
mine_functions:
|
||||
file.managed:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{% from 'salt/map.jinja' import interface -%}
|
||||
|
||||
[Unit]
|
||||
Description=The Salt Minion
|
||||
Documentation=man:salt-minion(1) file:///usr/share/doc/salt/html/contents.html https://docs.saltproject.io/en/latest/contents.html
|
||||
@@ -8,7 +10,7 @@ KillMode=process
|
||||
Type=notify
|
||||
NotifyAccess=all
|
||||
LimitNOFILE=8192
|
||||
ExecStartPre=/bin/bash -c 'until /sbin/ip -4 addr show dev {{ salt["pillar.get"]("host:mainint") }} | grep -q "inet "; do sleep 1; done'
|
||||
ExecStartPre=/bin/bash -c 'until /sbin/ip -4 addr show dev {{ interface }} | grep -q "inet "; do sleep 1; done'
|
||||
ExecStart=/usr/bin/salt-minion
|
||||
TimeoutStartSec=120
|
||||
|
||||
|
||||
Reference in New Issue
Block a user