
... to make the naming consistent with the actual option name in nova ([pci] device_spec). Change-Id: I7b5ec4669b47192a799f8dcc3672082547e25d76
52 lines
1.5 KiB
Puppet
52 lines
1.5 KiB
Puppet
# Class nova::compute::pci
|
|
#
|
|
# Configures nova compute pci options
|
|
#
|
|
# === Parameters:
|
|
#
|
|
# [*device_specs*]
|
|
# (optional) Specify the PCI devices available to VMs.
|
|
# Defaults to $facts['os_service_default']
|
|
# Example of format:
|
|
# [ { "vendor_id" => "1234","product_id" => "5678" },
|
|
# { "vendor_id" => "4321","product_id" => "8765", "physical_network" => "default" } ]
|
|
#
|
|
# [*report_in_placement*]
|
|
# (optional) Enable PCI resource inventory reporting to Placement.
|
|
# Defaults to $facts['os_service_default']
|
|
#
|
|
# DEPRECATED PARAMETERS
|
|
#
|
|
# [*passthrough*]
|
|
# (optional) Pci passthrough list of hash.
|
|
# Defaults to undef
|
|
#
|
|
class nova::compute::pci(
|
|
$device_specs = $facts['os_service_default'],
|
|
$report_in_placement = $facts['os_service_default'],
|
|
# DEPRECATED PARAMETERS
|
|
$passthrough = undef,
|
|
) {
|
|
include nova::deps
|
|
|
|
if $passthrough != undef {
|
|
warning('The passthrough parameter is deprecated. Use the device_specs parameter.')
|
|
if empty($passthrough) or is_service_default($passthrough) {
|
|
$device_specs_real = $facts['os_service_default']
|
|
} else {
|
|
$device_specs_real = to_array_of_json_strings($passthrough)
|
|
}
|
|
} else {
|
|
if empty($device_specs) or is_service_default($device_specs) {
|
|
$device_specs_real = $facts['os_service_default']
|
|
} else {
|
|
$device_specs_real = to_array_of_json_strings($device_specs)
|
|
}
|
|
}
|
|
|
|
nova_config {
|
|
'pci/device_spec': value => $device_specs_real;
|
|
'pci/report_in_placement': value => $report_in_placement;
|
|
}
|
|
}
|