mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
dynamic annotations
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
soc_hypervisor_pillar:
|
||||
file.managed:
|
||||
- name: /opt/so/saltstack/local/pillar/hypervisor/soc_hypervisor.sls
|
||||
- source: salt://hypervisor/pillar.map.jinja
|
||||
- template: jinja
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
hypervisor:
|
||||
hosts:
|
||||
defaultHost:
|
||||
add_guest:
|
||||
description: Add a new guest to the hypervisor.
|
||||
forcedType: "[]string"
|
||||
global: True
|
||||
multiline: True
|
||||
guests:
|
||||
defaultGuest:
|
||||
copper:
|
||||
description: Copper nics
|
||||
forcedType: "[]int"
|
||||
global: True
|
||||
multiline: True
|
||||
sfp:
|
||||
description: sfp nics
|
||||
forcedType: string
|
||||
global: True
|
||||
multiline: True
|
||||
disks:
|
||||
description: disk
|
||||
forcedType: "[]int"
|
||||
global: True
|
||||
multiline: True
|
||||
cpu:
|
||||
description: cpu
|
||||
forcedType: int
|
||||
global: True
|
||||
multiline: True
|
||||
memory:
|
||||
description: mem
|
||||
forcedType: int
|
||||
global: True
|
||||
multiline: True
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
hypervisor_annotation:
|
||||
file.managed:
|
||||
- name: /opt/so/saltstack/default/salt/hypervisor/soc_hypervisor.yaml
|
||||
- source: salt://soc/dynamic_annotations/hypervisor/soc_hypervisor.yaml.jinja
|
||||
- template: jinja
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{% import_yaml 'soc/dynamic_annotations/hypervisor/hypervisor.yaml' as ANNOTATION %}
|
||||
{% set HYPERVISORS = salt['pillar.get']('hypervisor:nodes', {}) %}
|
||||
|
||||
{% set TEMPLATE = ANNOTATION.hypervisor.hosts.pop('defaultHost') %}
|
||||
{# remove defaultGuest so that it is not shown in Grid Configuration UI #}
|
||||
{% do TEMPLATE['guests'].pop('defaultGuest') %}
|
||||
|
||||
{% for hypervisor in HYPERVISORS.hypervisor %}
|
||||
{% do ANNOTATION.hypervisor.hosts.update({hypervisor: TEMPLATE}) %}
|
||||
{% endfor %}
|
||||
|
||||
{{ ANNOTATION | yaml(False) }}
|
||||
|
||||
Reference in New Issue
Block a user