Update node_network resource

Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
Bogdan Dobrelya 2015-08-07 12:39:22 +02:00
parent b8cca2db09
commit dd654eac1d
3 changed files with 86 additions and 6 deletions

View File

@ -1,5 +1,9 @@
# Node network resource for puppet handler # Node network resource for puppet handler
Setup and configure L23 networking for a node Setup and configure L23 networking for a node.
Leverages the powerful network_scheme structures to
create all required networking entities like interfaces,
bridges, bonds - both linux and ovs based.
Defaults are given for Debian OS family.
source https://github.com/xenolog/l23network source https://github.com/xenolog/l23network

View File

@ -1,6 +1,41 @@
$resource = hiera($::resource_name) $resource = hiera($::resource_name)
#TODO
$ensure_package = $resource['input']['ensure_package']['value']
$use_lnx = $resource['input']['use_lnx']['value']
$use_ovs = $resource['input']['use_ovs']['value']
$install_ovs = $resource['input']['install_ovs']['value']
$install_brtool = $resource['input']['install_brtool']['value']
$install_ethtool = $resource['input']['install_ethtool']['value']
$install_bondtool = $resource['input']['install_bondtool']['value']
$install_vlantool = $resource['input']['install_vlantool']['value']
$ovs_modname = $resource['input']['ovs_modname']['value']
$ovs_datapath_package_name = $resource['input']['ovs_datapath_package_name']['value']
$ovs_common_package_name = $resource['input']['ovs_common_package_name']['value']
$network_scheme = $resource['input']['network_scheme']['value']
class {'l23network': class {'l23network':
package_ensure => $package_ensure, ensure_package => $ensure_package,
use_lnx => $use_lnx,
use_ovs => $use_ovs,
install_ovs => $install_ovs,
install_brtool => $install_brtool,
install_ethtool => $install_ethtool,
install_bondtool => $install_bondtool,
install_vlantool => $install_vlantool,
ovs_modname => $ovs_modname,
ovs_datapath_package_name => $ovs_datapath_package_name,
ovs_common_package_name => $ovs_common_package_name,
} }
prepare_network_config($network_scheme)
$sdn = generate_network_config()
notify { $sdn: require => Class['l23network'], }
# We need to wait at least 30 seconds for the bridges and other interfaces to
# come up after being created. This should allow for all interfaces to be up
# and ready for traffic before proceeding with further deploy steps. LP#1458954
exec { 'wait-for-interfaces':
path => '/usr/bin:/bin',
command => 'sleep 32',
require => Notify[$sdn]
}

View File

@ -3,14 +3,55 @@ handler: puppet
puppet_module: l23network puppet_module: l23network
version: 1.0.0 version: 1.0.0
input: input:
#TODO
package_ensure: package_ensure:
schema: str schema: str
value: 'present' value: 'present'
ensure_package:
schema: str
value: 'present'
use_lnx:
schema: bool
value: true
use_ovs:
schema: bool
value: false
install_ovs:
schema: bool
value: true
install_brtool:
schema: bool
value: true
install_ethtool:
schema: bool
value: true
install_bondtool:
schema: bool
value: true
install_vlantool:
schema: bool
value: true
ovs_modname:
schema: str
value: 'openvswitch'
ovs_datapath_package_name:
schema: str
value: 'openvswitch-datapath-dkms'
ovs_common_package_name:
schema: str
value: 'openvswitch-switch'
network_scheme:
schema: {
version: str!,
provider: str!,
interfaces: {},
transformations: {},
endpoints: {},
roles: {},
}
git: git:
schema: {repository: str!, branch: str!} schema: {repository: str!, branch: str!}
value: {repository: 'https://github.com/openstack/puppet-cinder', branch: '5.1.0'} value: {repository: 'https://github.com/xenolog/l23network', branch: 'master'}
ip: ip:
schema: str! schema: str!
@ -22,4 +63,4 @@ input:
schema: str! schema: str!
value: value:
tags: [resource/l23network_service, resources/l23network, resources/cinder] tags: [resources/l23network, resources/node_network]