diff --git a/pillar/top.sls b/pillar/top.sls index 76d1a14e1..1a0d5f8c6 100644 --- a/pillar/top.sls +++ b/pillar/top.sls @@ -307,6 +307,10 @@ base: - minions.{{ grains.id }} - minions.adv_{{ grains.id }} + '*_hypervisor': + - minions.{{ grains.id }} + - minions.adv_{{ grains.id }} + '*_desktop': - minions.{{ grains.id }} - minions.adv_{{ grains.id }} diff --git a/salt/allowed_states.map.jinja b/salt/allowed_states.map.jinja index 37795e9d7..1cdf6145e 100644 --- a/salt/allowed_states.map.jinja +++ b/salt/allowed_states.map.jinja @@ -199,6 +199,14 @@ 'kafka', 'stig' ], + 'so-hypervisor': [ + 'ssl', + 'telegraf', + 'firewall', + 'schedule', + 'docker_clean', + 'stig' + ], 'so-desktop': [ 'ssl', 'docker_clean', diff --git a/salt/firewall/defaults.yaml b/salt/firewall/defaults.yaml index c9b864a18..944c37992 100644 --- a/salt/firewall/defaults.yaml +++ b/salt/firewall/defaults.yaml @@ -1452,3 +1452,64 @@ firewall: portgroups: [] customhostgroup9: portgroups: [] + hypervisor: + chain: + DOCKER-USER: + hostgroups: + customhostgroup0: + portgroups: [] + customhostgroup1: + portgroups: [] + customhostgroup2: + portgroups: [] + customhostgroup3: + portgroups: [] + customhostgroup4: + portgroups: [] + customhostgroup5: + portgroups: [] + customhostgroup6: + portgroups: [] + customhostgroup7: + portgroups: [] + customhostgroup8: + portgroups: [] + customhostgroup9: + portgroups: [] + INPUT: + hostgroups: + anywhere: + portgroups: + - ssh + dockernet: + portgroups: + - all + localhost: + portgroups: + - all + manager: + portgroups: [] + managersearch: + portgroups: [] + standalone: + portgroups: [] + customhostgroup0: + portgroups: [] + customhostgroup1: + portgroups: [] + customhostgroup2: + portgroups: [] + customhostgroup3: + portgroups: [] + customhostgroup4: + portgroups: [] + customhostgroup5: + portgroups: [] + customhostgroup6: + portgroups: [] + customhostgroup7: + portgroups: [] + customhostgroup8: + portgroups: [] + customhostgroup9: + portgroups: [] diff --git a/salt/hypervisor/init.sls b/salt/hypervisor/init.sls new file mode 100644 index 000000000..e69de29bb diff --git a/salt/libvirt/init.sls b/salt/libvirt/init.sls index 4e9d0a6af..1e4e3dde0 100644 --- a/salt/libvirt/init.sls +++ b/salt/libvirt/init.sls @@ -9,18 +9,6 @@ install_libvirt: pkg.installed: - name: libvirt -libvirt_config: - file.managed: - - name: /etc/libvirt/libvirtd.conf - - source: salt://libvirt/etc/libvirtd.conf.jinja - - template: jinja - - defaults: - LIBVIRTMERGED: {{ LIBVIRTMERGED }} - -libvirt_service: - service.running: - - name: libvirtd - libvirt_conf_dir: file.directory: - name: /opt/so/conf/libvirt @@ -28,6 +16,28 @@ libvirt_conf_dir: - group: 939 - makedirs: True +libvirt_config: + file.managed: + - name: /opt/so/conf/libvirt/libvirtd.conf + - source: salt://libvirt/etc/libvirtd.conf.jinja + - template: jinja + - defaults: + LIBVIRTMERGED: {{ LIBVIRTMERGED }} + +# since the libvirtd service looks for the config at /etc/libvirt/libvirtd.conf, and we dont want to manage the service looking in a new location, create this symlink to the managed config +config_symlink: + file.symlink: + - name: /etc/libvirt/libvirtd.conf + - target: /opt/so/conf/libvirt/libvirtd.conf + - force: True + +libvirt_service: + service.running: + - name: libvirtd + - enable: True + - watch: + - file: libvirt_config + libvirt_source-packages_dir: file.directory: - name: /opt/so/conf/libvirt/source-packages @@ -60,24 +70,9 @@ install_libguestfs: pkg.installed: - name: libguestfs -# required for the network states below -install_NetworkManager-updown: +install-guestfs-tools: pkg.installed: - - name: NetworkManager-initscripts-updown - -ens18: - network.managed: - - enabled: True - - type: eth - - bridge: virbr0 - -virbr0: - network.managed: - - enabled: True - - type: bridge - - proto: dhcp - - require: - - network: ens18 + - name: guestfs-tools # virtlogd service may not restart following reboot without this #semanage permissive -a virtlogd_t diff --git a/salt/libvirt/source-packages/libvirt-python/libvirt_python-10.5.0-cp310-cp310-linux_x86_64.whl b/salt/libvirt/source-packages/libvirt-python/libvirt_python-10.5.0-cp310-cp310-linux_x86_64.whl deleted file mode 100644 index 5687a2862..000000000 Binary files a/salt/libvirt/source-packages/libvirt-python/libvirt_python-10.5.0-cp310-cp310-linux_x86_64.whl and /dev/null differ diff --git a/salt/libvirt/source-packages/libvirt-python/libvirt_python-10.6.0-cp310-cp310-linux_x86_64.whl b/salt/libvirt/source-packages/libvirt-python/libvirt_python-10.6.0-cp310-cp310-linux_x86_64.whl new file mode 100644 index 000000000..1ab49e395 Binary files /dev/null and b/salt/libvirt/source-packages/libvirt-python/libvirt_python-10.6.0-cp310-cp310-linux_x86_64.whl differ diff --git a/salt/manager/tools/sbin/so-minion b/salt/manager/tools/sbin/so-minion index e1cd48473..18c8c3224 100755 --- a/salt/manager/tools/sbin/so-minion +++ b/salt/manager/tools/sbin/so-minion @@ -560,6 +560,10 @@ function createRECEIVER() { add_telegraf_to_minion } +function createHYPERVISOR() { + add_telegraf_to_minion +} + function createDESKTOP() { add_desktop_to_minion add_telegraf_to_minion diff --git a/salt/telegraf/defaults.yaml b/salt/telegraf/defaults.yaml index 3cf2f731d..d32fff179 100644 --- a/salt/telegraf/defaults.yaml +++ b/salt/telegraf/defaults.yaml @@ -110,6 +110,10 @@ telegraf: - lasthighstate.sh - os.sh - sostatus.sh + hypervisor: + - lasthighstate.sh + - os.sh + - sostatus.sh desktop: - lasthighstate.sh - os.sh diff --git a/salt/top.sls b/salt/top.sls index 7365e0e83..0bfa03317 100644 --- a/salt/top.sls +++ b/salt/top.sls @@ -266,6 +266,16 @@ base: - elasticfleet.install_agent_grid - schedule + '*_hypervisor and G@saltversion:{{saltversion}}': + - match: compound + - ssl + - sensoroni + - telegraf + - firewall + - elasticfleet.install_agent_grid + - libvirt + - stig + '*_desktop and G@saltversion:{{saltversion}}': - ssl - sensoroni diff --git a/salt/vars/hypervisor.map.jinja b/salt/vars/hypervisor.map.jinja new file mode 100644 index 000000000..964f69663 --- /dev/null +++ b/salt/vars/hypervisor.map.jinja @@ -0,0 +1 @@ +{% set ROLE_GLOBALS = {} %} diff --git a/setup/so-functions b/setup/so-functions index 1931180ef..f80f702c1 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1166,11 +1166,7 @@ get_redirect() { get_minion_type() { local minion_type - case "$install_type" in - 'EVAL' | 'MANAGERSEARCH' | 'MANAGER' | 'SENSOR' | 'HEAVYNODE' | 'SEARCHNODE' | 'FLEET' | 'IDH' | 'STANDALONE' | 'IMPORT' | 'RECEIVER' | 'DESKTOP') - minion_type=$(echo "$install_type" | tr '[:upper:]' '[:lower:]') - ;; - esac + minion_type=$(echo "$install_type" | tr '[:upper:]' '[:lower:]') echo "$minion_type" }