-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13878 from Security-Onion-Solutions/vlb2
vlb2
- Loading branch information
Showing
13 changed files
with
142 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
hypervisor: | ||
nodes: [] | ||
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: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,15 @@ | ||
# This is the start of an example of what this file will look like. It will be generated by Salt, so this yaml file is not used by Salt. | ||
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 | ||
jpphype1: | ||
add_searchnode: | ||
description: Add a new searchnode to the hypervisor. | ||
file: true | ||
global: true | ||
multiline: true | ||
add_sensor: | ||
description: Add a new sensor to the hypervisor. | ||
file: true | ||
global: true | ||
multiline: true | ||
guests: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
hostname: | ||
network_mode: | ||
ip4: | ||
gw4: | ||
dns4: | ||
sarch4: | ||
cpu: | ||
memory: | ||
disk: | ||
copper: | ||
sfp: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
{% from 'soc/dynamic_annotations/hypervisor/map.jinja' import HYPERVISORS %} | ||
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 | ||
- defaults: | ||
HYPERVISORS: {{ HYPERVISORS }} | ||
{% for role in HYPERVISORS %} | ||
{% for hypervisor in HYPERVISORS[role].keys() %} | ||
hypervisor_host_directory_{{hypervisor}}: | ||
file.directory: | ||
- name: /opt/so/saltstack/local/salt/hypervisor/hosts/{{hypervisor}} | ||
- makedirs: True | ||
add_searchnode_file_{{hypervisor}}: | ||
file.managed: | ||
- name: /opt/so/saltstack/local/salt/hypervisor/hosts/{{hypervisor}}/add_searchnode | ||
- source: salt://soc/dynamic_annotations/hypervisor/add_node | ||
add_sensor_file_{{hypervisor}}: | ||
file.managed: | ||
- name: /opt/so/saltstack/local/salt/hypervisor/hosts/{{hypervisor}}/add_sensor | ||
- source: salt://soc/dynamic_annotations/hypervisor/add_node | ||
{% endfor %} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% set HYPERVISORS = salt['pillar.get']('hypervisor:nodes', {}) %} |
7 changes: 4 additions & 3 deletions
7
salt/soc/dynamic_annotations/hypervisor/soc_hypervisor.yaml.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
{% 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}) %} | ||
{% for role in HYPERVISORS %} | ||
{% for hypervisor in HYPERVISORS[role].keys() %} | ||
{% do ANNOTATION.hypervisor.hosts.update({hypervisor: TEMPLATE}) %} | ||
{% endfor %} | ||
{% endfor %} | ||
|
||
{{ ANNOTATION | yaml(False) }} |