Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some misspellings in the l23network module #228

Merged
merged 1 commit into from
May 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix some misspellings in the l23network module
Contain only fix for some misspellings and puppet code cleanup.

FUEL-Change-Id: I1e042048ab438b4254ee4a8d02aecdcaa6bb9332
FUEL-Closes-Bug: #1533357
FUEL-Partial-Bug: #1533240
  • Loading branch information
mmalchuk authored and Sergey Vasilenko committed May 27, 2016
commit 508675f0da3568b959b1a0c4e8504964d3e296f0
3 changes: 1 addition & 2 deletions manifests/examples/run_network_scheme.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
$settings_yaml
){

class {'l23network': }
class {'::l23network': }

$config = parseyaml($settings_yaml)
prepare_network_config($config['network_scheme'])
$sdn = generate_network_config()
notice("SDN ${sdn}")
}
###
22 changes: 11 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
$disable_hotplug = true,
){

include stdlib
include ::stdlib
include ::l23network::params

class { 'l23network::l2':
class { '::l23network::l2':
ensure_package => $ensure_package,
use_ovs => $use_ovs,
use_lnx => $use_lnx,
Expand All @@ -60,24 +60,24 @@
}

if $::l23network::params::interfaces_file {
if ! defined(File["${::l23network::params::interfaces_file}"]) {
file {"${::l23network::params::interfaces_file}":
ensure => present,
source => 'puppet:///modules/l23network/interfaces',
if ! defined(File[$::l23network::params::interfaces_file]) {
file { $::l23network::params::interfaces_file:
ensure => present,
source => 'puppet:///modules/l23network/interfaces',
}
}
File<| title == "${::l23network::params::interfaces_file}" |> -> File<| title == "${::l23network::params::interfaces_dir}" |>
File<| title == $::l23network::params::interfaces_file |> -> File<| title == $::l23network::params::interfaces_dir |>
}

if ! defined(File["${::l23network::params::interfaces_dir}"]) {
file {"${::l23network::params::interfaces_dir}":
if ! defined(File[$::l23network::params::interfaces_dir]) {
file { $::l23network::params::interfaces_dir:
ensure => directory,
owner => 'root',
mode => '0755',
} -> Anchor['l23network::init']
}
Anchor['l23network::l2::init'] -> File<| title == "${::l23network::params::interfaces_dir}" |>
Anchor['l23network::l2::init'] -> File<| title == "${::l23network::params::interfaces_file}" |>
Anchor['l23network::l2::init'] -> File<| title == $::l23network::params::interfaces_dir |>
Anchor['l23network::l2::init'] -> File<| title == $::l23network::params::interfaces_file |>

# Centos interface up-n-down scripts
if $::l23_os =~ /(?i:redhat|centos)/ {
Expand Down
7 changes: 4 additions & 3 deletions manifests/l2.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,24 @@
$ovs_datapath_package_name = $::l23network::params::ovs_datapath_package_name,
$ovs_common_package_name = $::l23network::params::ovs_common_package_name,
){
include stdlib

include ::stdlib
include ::l23network::params

if $use_ovs {
$ovs_mod_ensure = present
if $install_ovs {
if $use_ovs_dkms_datapath_module {
package { 'openvswitch-datapath':
name => $ovs_datapath_package_name,
ensure => $ensure_package,
name => $ovs_datapath_package_name,
}
Package['openvswitch-datapath'] -> Service['openvswitch-service']
}
if $ovs_common_package_name {
package { 'openvswitch-common':
name => $ovs_common_package_name,
ensure => $ensure_package,
name => $ovs_common_package_name,
}
Package['openvswitch-common'] ~> Service['openvswitch-service']
}
Expand Down
14 changes: 9 additions & 5 deletions manifests/l2/bond.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
# downdelay
#
# [*provider*]
# This manifest supports lnx or ovs providers.
# This manifest supports lnx or ovs providers.
#
# [*interface_properties*]
# Configuration options for included interfaces (mtu, ethtool, etc...)
#

define l23network::l2::bond (
$ensure = present,
Expand All @@ -38,7 +42,7 @@
$onboot = undef,
$delay_while_up = undef,
$bond_properties = {},
$interface_properties = undef, # configuration options for included interfaces (mtu, ethtool, etc...)
$interface_properties = undef,
$vendor_specific = undef,
$monolith_bond_providers = undef,
$provider = undef,
Expand Down Expand Up @@ -167,7 +171,7 @@
}

if $delay_while_up and ! is_numeric($delay_while_up) {
fail("Delay for waiting after UP interface ${port} should be numeric, not an ${delay_while_up}.")
fail("Delay for waiting after UP interface ${bond} should be numeric, not an ${delay_while_up}.")
}

if ! $bridge and $provider == 'ovs' {
Expand Down Expand Up @@ -202,8 +206,8 @@

if (! defined(L23network::L2::Bridge[$bridge]) and $provider == 'ovs') {
l23network::l2::bridge { $bridge:
ensure => 'present',
provider => $provider,
ensure => 'present',
provider => $provider,
}
}

Expand Down
1 change: 0 additions & 1 deletion manifests/l2/bond_interface.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@
}
}
}
###
6 changes: 3 additions & 3 deletions manifests/l2/bridge.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$stp = undef,
$bpdu_forward = true,
# $bridge_id = undef, # will be implemented later
$external_ids = { 'bridge-id' => "${name}" },
$external_ids = { 'bridge-id' => $name },
$delay_while_up = undef,
$vendor_specific = undef,
$provider = undef,
Expand All @@ -34,7 +34,7 @@
}

if $delay_while_up and ! is_numeric($delay_while_up) {
fail("Delay for waiting after UP bridge ${name} should be numeric, not an '$delay_while_up'.")
fail("Delay for waiting after UP bridge ${name} should be numeric, not an '${delay_while_up}'.")
}

if ! defined (L23_stored_config[$name]) {
Expand Down Expand Up @@ -74,7 +74,7 @@
ensure => present,
owner => 'root',
mode => '0755',
content => template("l23network/centos_post_up.erb"),
content => template('l23network/centos_post_up.erb'),
} -> L23_stored_config <| title == $name |>
} else {
file {"${::l23network::params::interfaces_dir}/interface-up-script-${name}":
Expand Down
24 changes: 12 additions & 12 deletions manifests/l2/centos_upndown_scripts.pp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# see http://tech.serbinn.net/2012/custom-script-on-interface-up-down-centos-and-rhel/
class l23network::l2::centos_upndown_scripts {
file {'/sbin/ifup-local':
ensure => present,
owner => 'root',
mode => '0755',
source => 'puppet:///modules/l23network/centos_ifup-local',
ensure => present,
owner => 'root',
mode => '0755',
source => 'puppet:///modules/l23network/centos_ifup-local',
} ->
file {'/sbin/ifdown-local':
ensure => present,
owner => 'root',
mode => '0755',
source => 'puppet:///modules/l23network/centos_ifdown-local',
ensure => present,
owner => 'root',
mode => '0755',
source => 'puppet:///modules/l23network/centos_ifdown-local',
} ->
file {'/sbin/ifup-pre-local':
ensure => present,
owner => 'root',
mode => '0755',
source => 'puppet:///modules/l23network/centos_ifup-pre-local',
ensure => present,
owner => 'root',
mode => '0755',
source => 'puppet:///modules/l23network/centos_ifup-pre-local',
} ->
anchor { 'l23network::l2::centos_upndown_scripts': }
}
25 changes: 5 additions & 20 deletions manifests/l3/ifconfig.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,13 @@
# IP address for interface. Can contain IP address, 'dhcp'
# or 'none' (with no IP address).
# Can be an array of CIDR IP addresses ['192.168.1.3/24','10.0.0.4/16']
# for multiple IPs on an interface. In this case netmask parameter is ignored.
#
# [*netmask*]
# Specify network mask. Default is '255.255.255.0'.
# for multiple IPs on an interface.
#
# [*gateway*]
# Specify default gateway if need.
# You can specify IP address, or 'save' for save default route
# if it lies through this interface now.
#
## [*default_gateway*]
## Specify if this nic and gateway should become the default route.
## requires that gateway is also set.
##
## [*other_nets*]
## Optional. Defines additional networks that this inteface can reach in CIDR
## format.
Expand Down Expand Up @@ -69,7 +62,6 @@
$dns_search = undef,
$dns_domain = undef,
$dhcp_hostname = undef,
# $dhcp_nowait = false,
$check_by_ping = 'gateway',
$check_by_ping_timeout = 30,
#todo: label => "XXX", # -- "ip addr add..... label XXX"
Expand All @@ -92,23 +84,16 @@
$ipaddr_aliases = undef
case $ipaddr {
'dhcp': {
$method = 'dhcp'
$method = 'dhcp'
$ipaddr_list = ['dhcp']
}
'none': {
$method = 'manual'
$method = 'manual'
$ipaddr_list = ['none']
}
default: {
$method = 'static'
if $ipaddr =~ /\/\d{1,2}\s*$/ {
# ipaddr can be cidr-notated
$ipaddr_list = [$ipaddr]
} else {
# or classic pair of ipaddr+netmask
$cidr_notated_effective_netmask = netmask_to_cidr($netmask)
$ipaddr_list = ["${ipaddr}/${cidr_notated_effective_netmask}"]
}
$method = 'static'
$ipaddr_list = [$ipaddr]
}
}
} else {
Expand Down