mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-02-08 00:04:06 +01:00
dynamic annotations
This commit is contained in:
@@ -1,61 +1,79 @@
|
||||
hypervisor:
|
||||
model1:
|
||||
hardware:
|
||||
cpu:
|
||||
total: 128
|
||||
free: 128
|
||||
memory:
|
||||
total: 128
|
||||
free: 128
|
||||
disks:
|
||||
free:
|
||||
3: pci_0000_c7_00_0
|
||||
4: pci_0000_c8_00_0
|
||||
claimed:
|
||||
1: pci_0000_c5_00_0
|
||||
2: pci_0000_c6_00_0
|
||||
copper:
|
||||
free:
|
||||
1: pci_0000_c4_00_0
|
||||
2: pci_0000_c4_00_1
|
||||
3: pci_0000_c4_00_2
|
||||
4: pci_0000_c4_00_3
|
||||
claimed: {}
|
||||
sfp:
|
||||
free:
|
||||
5: pci_0000_41_00_0
|
||||
6: pci_0000_41_00_1
|
||||
claimed: {}
|
||||
model2:
|
||||
hardware:
|
||||
cpu:
|
||||
total: 128
|
||||
free: 128
|
||||
memory:
|
||||
total: 512
|
||||
free: 512
|
||||
disks:
|
||||
free:
|
||||
3: pci_0000_c8_00_0
|
||||
4: pci_0000_c9_00_0
|
||||
5: pci_0000_c10_00_0
|
||||
6: pci_0000_c11_00_0
|
||||
claimed:
|
||||
1: pci_0000_c6_00_0
|
||||
2: pci_0000_c7_00_0
|
||||
copper:
|
||||
free:
|
||||
1: pci_0000_c4_00_0
|
||||
2: pci_0000_c4_00_1
|
||||
3: pci_0000_c4_00_2
|
||||
4: pci_0000_c4_00_3
|
||||
5: pci_0000_c5_00_0
|
||||
6: pci_0000_c5_00_1
|
||||
7: pci_0000_c5_00_2
|
||||
8: pci_0000_c5_00_3
|
||||
claimed: {}
|
||||
sfp:
|
||||
free:
|
||||
9: pci_0000_41_00_0
|
||||
10: pci_0000_41_00_1
|
||||
claimed: {}
|
||||
nodes:
|
||||
jpphype1:
|
||||
add_guest: []
|
||||
guests:
|
||||
- sen1_sensor:
|
||||
cpu: 2
|
||||
mem: 8192
|
||||
|
||||
jpphype1:
|
||||
guests:
|
||||
sen1_sensor:
|
||||
hardware:
|
||||
cpu: 2
|
||||
mem: 8192
|
||||
|
||||
|
||||
|
||||
models:
|
||||
model1:
|
||||
hardware:
|
||||
cpu:
|
||||
total: 128
|
||||
free: 128
|
||||
memory:
|
||||
total: 128
|
||||
free: 128
|
||||
disks:
|
||||
free:
|
||||
3: pci_0000_c7_00_0
|
||||
4: pci_0000_c8_00_0
|
||||
claimed:
|
||||
1: pci_0000_c5_00_0
|
||||
2: pci_0000_c6_00_0
|
||||
copper:
|
||||
free:
|
||||
1: pci_0000_c4_00_0
|
||||
2: pci_0000_c4_00_1
|
||||
3: pci_0000_c4_00_2
|
||||
4: pci_0000_c4_00_3
|
||||
claimed: {}
|
||||
sfp:
|
||||
free:
|
||||
5: pci_0000_41_00_0
|
||||
6: pci_0000_41_00_1
|
||||
claimed: {}
|
||||
model2:
|
||||
hardware:
|
||||
cpu:
|
||||
total: 128
|
||||
free: 128
|
||||
memory:
|
||||
total: 512
|
||||
free: 512
|
||||
disks:
|
||||
free:
|
||||
3: pci_0000_c8_00_0
|
||||
4: pci_0000_c9_00_0
|
||||
5: pci_0000_c10_00_0
|
||||
6: pci_0000_c11_00_0
|
||||
claimed:
|
||||
1: pci_0000_c6_00_0
|
||||
2: pci_0000_c7_00_0
|
||||
copper:
|
||||
free:
|
||||
1: pci_0000_c4_00_0
|
||||
2: pci_0000_c4_00_1
|
||||
3: pci_0000_c4_00_2
|
||||
4: pci_0000_c4_00_3
|
||||
5: pci_0000_c5_00_0
|
||||
6: pci_0000_c5_00_1
|
||||
7: pci_0000_c5_00_2
|
||||
8: pci_0000_c5_00_3
|
||||
claimed: {}
|
||||
sfp:
|
||||
free:
|
||||
9: pci_0000_41_00_0
|
||||
10: pci_0000_41_00_1
|
||||
claimed: {}
|
||||
|
||||
29
salt/hypervisor/pillar.map.jinja
Normal file
29
salt/hypervisor/pillar.map.jinja
Normal file
@@ -0,0 +1,29 @@
|
||||
{% set HYPERVISORHOSTS = salt['pillar.get']('hypervisor:hosts', {}) %}
|
||||
|
||||
{% import_yaml 'setup/virt/sensor.yaml' as SENSOR %}
|
||||
{% import_yaml 'setup/virt/searchnode.yaml' as SEARCHNODE %}
|
||||
|
||||
{% set vars = {
|
||||
'sensor': SENSOR,
|
||||
'searchnode': SEARCHNODE
|
||||
} %}
|
||||
|
||||
{% for host, guestDetails in HYPERVISORHOSTS.items() %}
|
||||
{% if guestDetails['add_guest'] | length > 0 %}
|
||||
{% for newGuest in guestDetails['add_guest'] %}
|
||||
{% set indx = guestDetails['add_guest'].index(newGuest) %}
|
||||
{% do guestDetails['add_guest'].pop(indx) %}
|
||||
{% set NODETYPE = newGuest.split('_') | last %}
|
||||
{% do guestDetails['guests'].update({
|
||||
newGuest: {
|
||||
'cpu': vars[NODETYPE].CPU,
|
||||
'memory': vars[NODETYPE].MEMORY,
|
||||
'disk': vars[NODETYPE].DISKS,
|
||||
'copper': vars[NODETYPE].COPPER,
|
||||
'sfp': vars[NODETYPE].SFP
|
||||
}
|
||||
}) %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
0
salt/hypervisor/pillar.sls
Normal file
0
salt/hypervisor/pillar.sls
Normal file
35
salt/hypervisor/soc_hypervisor.yaml
Normal file
35
salt/hypervisor/soc_hypervisor.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
hypervisor:
|
||||
hosts:
|
||||
defaultHost:
|
||||
add_guest:
|
||||
description: List of hypervisor nodes.
|
||||
forcedType: "[]string"
|
||||
global: True
|
||||
multiline: True
|
||||
guests:
|
||||
defaultGuest:
|
||||
copper:
|
||||
description: Copper nics
|
||||
forcedType: "[]int"
|
||||
global: True
|
||||
multiline: True
|
||||
sfp:
|
||||
description: sfp nics
|
||||
forcedType: "[]int"
|
||||
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
salt/soc/dynamic_annotations/hypervisor/init.sls
Normal file
0
salt/soc/dynamic_annotations/hypervisor/init.sls
Normal file
Reference in New Issue
Block a user