2 # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
18 # == Class: neutron::agents::ml2::sriov
20 # Setups SR-IOV neutron agent when using ML2 plugin
25 # (optional) The state of the package
26 # Defaults to 'present'
29 # (required) Whether or not to enable the OVS Agent
32 # [*physical_device_mappings*]
33 # (optional) List of <physical_network>:<physical device>
34 # All physical networks listed in network_vlan_ranges
35 # on the server should have mappings to appropriate
36 # interfaces on each agent.
37 # Defaults to empty list
39 # [*polling_interval*]
40 # (optional) The number of seconds the agent will wait between
41 # polling for local device changes.
45 # (optional) List of <network_device>:<excluded_devices> mapping
46 # network_device to the agent's node-specific list of virtual functions
47 # that should not be used for virtual networking. excluded_devices is a
48 # semicolon separated list of virtual functions to exclude from network_device.
49 # The network_device in the mapping should appear in the physical_device_mappings list.
50 class neutron::agents::ml2::sriov (
51 $package_ensure = 'present',
53 $physical_device_mappings = [],
54 $polling_interval = 2,
55 $exclude_devices = [],
58 include neutron::params
60 Neutron_plugin_ml2<||> ~> Service['neutron-sriov-nic-agent-service']
63 'sriov_nic/polling_interval': value => $polling_interval;
64 'sriov_nic/exclude_devices': value => join($exclude_devices, ',');
65 'sriov_nic/physical_device_mappings': value => join($physical_device_mappings, ',');
69 Package['neutron-sriov-nic-agent'] -> Neutron_plugin_ml2<||>
70 package { 'neutron-sriov-nic-agent':
71 ensure => $package_ensure,
72 name => $::neutron::params::sriov_nic_agent_package,
76 $service_ensure = 'running'
78 $service_ensure = 'stopped'
81 service { 'neutron-sriov-nic-agent-service':
82 ensure => $service_ensure,
83 name => $::neutron::params::sriov_nic_agent_service,
85 require => Class['neutron'],