Skip to content

Instantly share code, notes, and snippets.

@cardoe
Created February 1, 2025 23:59
Show Gist options
  • Save cardoe/82ca7d2a33ae963dbe30f2b43ac13f64 to your computer and use it in GitHub Desktop.
Save cardoe/82ca7d2a33ae963dbe30f2b43ac13f64 to your computer and use it in GitHub Desktop.
ironic-inspect-hooks-and-rules-use-case
- description: Check m1.small hardware model
conditions:
- op: eq
args: ["{inventory[system_vendor][manufacturer]}", "Dell"]
- op: eq
args: ["{inventory[system_vendor][model]}", "PowerEdge R7615"]
- op: eq
args: ["{inventory[cpu][model_name]}", "AMD"]
- op: "!is-empty"
args: ["{plugin_data[bmc_address}"]
actions:
- op: set-attribute
args: ["/driver", "idrac"]
- op: set-attribute
args: ["/resource_class", "CUSTOM.M1.SMALL"]
# https://github.com/rackerlabs/understack/blob/main/schema/flavor.schema.json
name: m1.small
# next two lines tie us back to the Nautobot/Netbox device-types
manufacturer: Dell
model: PowerEdge R7615
# the rest defines what must exist for this flavor
cpu_model: AMD
cpu_cores: 16
memory_gb: 384
drives:
- 480
- 480
pci:
- name: Some Vendor NIC
vendor_id: 0x8086
device_id: 0x1000
sub_vendor_id: 0x8086
sub_device_id: 0x1000
# https://github.com/netbox-community/devicetype-library/blob/master/device-types/Dell/PowerEdge-R7615.yaml
# essentially just using the above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment