Faidon Liambotis has submitted this change and it was merged.

Change subject: interface: drop support for Ubuntu < 10.04
......................................................................


interface: drop support for Ubuntu < 10.04

Change-Id: Ifb5f1761c63971f0d6320c3f8631b3857a325de2
---
M modules/interface/manifests/aggregate.pp
M modules/interface/manifests/ip.pp
M modules/interface/manifests/manual.pp
M modules/interface/manifests/setting.pp
M modules/interface/manifests/tagged.pp
M modules/interface/manifests/tun6to4.pp
M modules/interface/manifests/up_command.pp
7 files changed, 111 insertions(+), 127 deletions(-)

Approvals:
  Filippo Giunchedi: Looks good to me, but someone else must approve
  Faidon Liambotis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/interface/manifests/aggregate.pp 
b/modules/interface/manifests/aggregate.pp
index 19bea7c..089f9a4 100644
--- a/modules/interface/manifests/aggregate.pp
+++ b/modules/interface/manifests/aggregate.pp
@@ -3,23 +3,21 @@
 
     $interface = $title
 
-    if $::lsbdistid == 'Ubuntu' and versioncmp($::lsbdistrelease, '10.04') >= 
0 {
-        augeas { "aggregate member ${interface}":
-            context => '/files/etc/network/interfaces/',
-            changes => [
-                    "set auto[./1 = '${interface}']/1 '${interface}'",
-                    "set iface[. = '${interface}'] '${interface}'",
-                    "set iface[. = '${interface}']/family 'inet'",
-                    "set iface[. = '${interface}']/method 'manual'",
-            ],
-            notify  => Exec["ifup ${interface}"]
-        }
+    augeas { "aggregate member ${interface}":
+        context => '/files/etc/network/interfaces/',
+        changes => [
+                "set auto[./1 = '${interface}']/1 '${interface}'",
+                "set iface[. = '${interface}'] '${interface}'",
+                "set iface[. = '${interface}']/family 'inet'",
+                "set iface[. = '${interface}']/method 'manual'",
+        ],
+        notify  => Exec["ifup ${interface}"]
+    }
 
-        exec { "ifup ${interface}":
-            command     => "/sbin/ifup --force ${interface}; /sbin/ip link set 
dev ${interface} up",
-            require     => Augeas["aggregate member ${interface}"],
-            refreshonly => true
-        }
+    exec { "ifup ${interface}":
+        command     => "/sbin/ifup --force ${interface}; /sbin/ip link set dev 
${interface} up",
+        require     => Augeas["aggregate member ${interface}"],
+        refreshonly => true
     }
 }
 
@@ -29,64 +27,62 @@
     # Use the definition title as the destination (aggregated) interface
     $aggr_interface = $title
 
-    if $::lsbdistid == 'Ubuntu' and versioncmp($::lsbdistrelease, '10.04') >= 
0 {
-        if $orig_interface != '' {
-            # Convert an existing interface, e.g. from eth0 to bond0
-            $augeas_changes = [
-                "set auto[./1 = '${orig_interface}']/1 '${aggr_interface}'",
-                "set iface[. = '${orig_interface}'] '${aggr_interface}'"
-            ]
+    if $orig_interface != '' {
+        # Convert an existing interface, e.g. from eth0 to bond0
+        $augeas_changes = [
+            "set auto[./1 = '${orig_interface}']/1 '${aggr_interface}'",
+            "set iface[. = '${orig_interface}'] '${aggr_interface}'"
+        ]
 
-            # Bring down the old interface after conversion
-            exec { "ip addr flush dev ${orig_interface}":
-                command     => "/sbin/ip addr flush dev ${orig_interface}",
-                before      => Exec["ifup ${aggr_interface}"],
-                subscribe   => Augeas["create ${aggr_interface}"],
-                refreshonly => true,
-                notify      => Exec["ifup ${aggr_interface}"]
-            }
-        } else {
-            $augeas_changes = [
-                "set auto[./1 = '${aggr_interface}']/1 '${aggr_interface}'",
-                "set iface[. = '${aggr_interface}'] '${aggr_interface}'",
-                "set iface[. = '${aggr_interface}']/family 'inet'",
-                "set iface[. = '${aggr_interface}']/method 'manual'"
-            ]
+        # Bring down the old interface after conversion
+        exec { "ip addr flush dev ${orig_interface}":
+            command     => "/sbin/ip addr flush dev ${orig_interface}",
+            before      => Exec["ifup ${aggr_interface}"],
+            subscribe   => Augeas["create ${aggr_interface}"],
+            refreshonly => true,
+            notify      => Exec["ifup ${aggr_interface}"]
         }
+    } else {
+        $augeas_changes = [
+            "set auto[./1 = '${aggr_interface}']/1 '${aggr_interface}'",
+            "set iface[. = '${aggr_interface}'] '${aggr_interface}'",
+            "set iface[. = '${aggr_interface}']/family 'inet'",
+            "set iface[. = '${aggr_interface}']/method 'manual'"
+        ]
+    }
 
-        augeas { "create ${aggr_interface}":
-            context => '/files/etc/network/interfaces/',
-            changes => $augeas_changes,
-            onlyif  => "match iface[. = '${aggr_interface}'] size == 0",
-            notify  => Exec["ifup ${aggr_interface}"]
-        }
+    augeas { "create ${aggr_interface}":
+        context => '/files/etc/network/interfaces/',
+        changes => $augeas_changes,
+        onlyif  => "match iface[. = '${aggr_interface}'] size == 0",
+        notify  => Exec["ifup ${aggr_interface}"]
+    }
 
-        augeas { "configure ${aggr_interface}":
-            require => Augeas["create ${aggr_interface}"],
-            context => '/files/etc/network/interfaces/',
-            changes => [
-                inline_template("set iface[. = '<%= aggr_interface 
%>']/bond-slaves '<%= members.join(' ') %>"),
-                "set iface[. = '${aggr_interface}']/bond-mode '802.3ad'",
-                "set iface[. = '${aggr_interface}']/bond-lacp-rate 
'${lacp_rate}'",
-                "set iface[. = '${aggr_interface}']/bond-miimon '100'",
-                "set iface[. = '${aggr_interface}']/bond-xmit-hash-policy 
'${hash_policy}'"
-            ],
-            notify  => Exec["ifup ${aggr_interface}"]
-        }
+    augeas { "configure ${aggr_interface}":
+        require => Augeas["create ${aggr_interface}"],
+        context => '/files/etc/network/interfaces/',
+        changes => [
+            inline_template("set iface[. = '<%= aggr_interface 
%>']/bond-slaves '<%= members.join(' ') %>"),
+            "set iface[. = '${aggr_interface}']/bond-mode '802.3ad'",
+            "set iface[. = '${aggr_interface}']/bond-lacp-rate '${lacp_rate}'",
+            "set iface[. = '${aggr_interface}']/bond-miimon '100'",
+            "set iface[. = '${aggr_interface}']/bond-xmit-hash-policy 
'${hash_policy}'"
+        ],
+        notify  => Exec["ifup ${aggr_interface}"]
+    }
 
-        # Define all aggregate members
-        interface::aggregate_member{ $members:
-            require => Augeas["create ${aggr_interface}"],
-            master  => $aggr_interface,
-            notify  => Exec["ifup ${aggr_interface}"]
-        }
+    # Define all aggregate members
+    interface::aggregate_member{ $members:
+        require => Augeas["create ${aggr_interface}"],
+        master  => $aggr_interface,
+        notify  => Exec["ifup ${aggr_interface}"]
+    }
 
-        # Bring up the new interface
-        exec { "ifup ${aggr_interface}":
-            command     => "/sbin/ifup --force ${aggr_interface}",
-            require     => Interface::Aggregate_member[$members],
-            refreshonly => true
-        }
+    # Bring up the new interface
+    exec { "ifup ${aggr_interface}":
+        command     => "/sbin/ifup --force ${aggr_interface}",
+        require     => Interface::Aggregate_member[$members],
+        refreshonly => true
     }
 }
 
diff --git a/modules/interface/manifests/ip.pp 
b/modules/interface/manifests/ip.pp
index 86b7953..e8ef5e0 100644
--- a/modules/interface/manifests/ip.pp
+++ b/modules/interface/manifests/ip.pp
@@ -3,13 +3,11 @@
     $prefix = "${address}/${prefixlen}"
     $ipaddr_command = "ip addr add ${prefix} dev ${interface}"
 
-    if $::lsbdistid == 'Ubuntu' and versioncmp($::lsbdistrelease, '10.04') >= 
0 {
-        # Use augeas to add an 'up' command to the interface
-        augeas { "${interface}_${prefix}":
-            context => "/files/etc/network/interfaces/*[. = '${interface}' and 
./family = 'inet']",
-            changes => "set up[last()+1] '${ipaddr_command}'",
-            onlyif  => "match up[. = '${ipaddr_command}'] size == 0";
-        }
+    # Use augeas to add an 'up' command to the interface
+    augeas { "${interface}_${prefix}":
+        context => "/files/etc/network/interfaces/*[. = '${interface}' and 
./family = 'inet']",
+        changes => "set up[last()+1] '${ipaddr_command}'",
+        onlyif  => "match up[. = '${ipaddr_command}'] size == 0";
     }
 
     # Add the IP address manually as well
diff --git a/modules/interface/manifests/manual.pp 
b/modules/interface/manifests/manual.pp
index 7126048..cbf1981 100644
--- a/modules/interface/manifests/manual.pp
+++ b/modules/interface/manifests/manual.pp
@@ -1,15 +1,13 @@
 define interface::manual($interface, $family='inet') {
-    if $::lsbdistid == 'Ubuntu' and versioncmp($::lsbdistrelease, '10.04') >= 
0 {
-        # Use augeas to create a new manually setup interface
-        $augeas_cmd = [ "set auto[./1 = '${interface}']/1 '${interface}'",
-                "set iface[. = '${interface}'] '${interface}'",
-                "set iface[. = '${interface}']/family '${family}'",
-                "set iface[. = '${interface}']/method 'manual'",
-        ]
+    # Use augeas to create a new manually setup interface
+    $augeas_cmd = [ "set auto[./1 = '${interface}']/1 '${interface}'",
+            "set iface[. = '${interface}'] '${interface}'",
+            "set iface[. = '${interface}']/family '${family}'",
+            "set iface[. = '${interface}']/method 'manual'",
+    ]
 
-        augeas { "${interface}_manual":
-            context => '/files/etc/network/interfaces',
-            changes => $augeas_cmd;
-        }
+    augeas { "${interface}_manual":
+        context => '/files/etc/network/interfaces',
+        changes => $augeas_cmd;
     }
 }
diff --git a/modules/interface/manifests/setting.pp 
b/modules/interface/manifests/setting.pp
index 10b5ca2..b02a6ee 100644
--- a/modules/interface/manifests/setting.pp
+++ b/modules/interface/manifests/setting.pp
@@ -3,10 +3,8 @@
 # Change an interface setting via augeas in /etc/network/interfaces
 
 define interface::setting($interface, $setting, $value) {
-    if $::lsbdistid == 'Ubuntu' and versioncmp($::lsbdistrelease, '10.04') >= 
0 {
-        augeas { "${interface}_${title}":
-            context => "/files/etc/network/interfaces/*[. = '${interface}' and 
family = 'inet']",
-            changes => "set ${setting} '${value}'",
-        }
+    augeas { "${interface}_${title}":
+        context => "/files/etc/network/interfaces/*[. = '${interface}' and 
family = 'inet']",
+        changes => "set ${setting} '${value}'",
     }
 }
diff --git a/modules/interface/manifests/tagged.pp 
b/modules/interface/manifests/tagged.pp
index 31971fe..4c38756 100644
--- a/modules/interface/manifests/tagged.pp
+++ b/modules/interface/manifests/tagged.pp
@@ -57,24 +57,22 @@
             ]
     }
 
-    if $::lsbdistid == 'Ubuntu' and versioncmp($::lsbdistrelease, '10.04') >= 
0 {
-        if $remove == 'true' {
-            exec { "/sbin/ifdown ${intf}":
-                before => Augeas[$intf],
-            }
+    if $remove == 'true' {
+        exec { "/sbin/ifdown ${intf}":
+            before => Augeas[$intf],
         }
+    }
 
-        # Use augeas
-        augeas { $intf:
-            context => '/files/etc/network/interfaces/',
-            changes => $augeas_cmd;
-        }
+    # Use augeas
+    augeas { $intf:
+        context => '/files/etc/network/interfaces/',
+        changes => $augeas_cmd;
+    }
 
-        if $remove != 'true' {
-            exec { "/sbin/ifup ${intf}":
-                subscribe => Augeas[$intf],
-                refreshonly => true,
-            }
+    if $remove != 'true' {
+        exec { "/sbin/ifup ${intf}":
+            subscribe => Augeas[$intf],
+            refreshonly => true,
         }
     }
 }
diff --git a/modules/interface/manifests/tun6to4.pp 
b/modules/interface/manifests/tun6to4.pp
index 02385d3..a4f59f0 100644
--- a/modules/interface/manifests/tun6to4.pp
+++ b/modules/interface/manifests/tun6to4.pp
@@ -17,23 +17,21 @@
             ]
     }
 
-    if $::lsbdistid == 'Ubuntu' and versioncmp($::lsbdistrelease, '10.04') >= 
0 {
-        if $remove == 'true' {
-            exec { '/sbin/ifdown tun6to4':
-                before => Augeas['tun6to4'],
-            }
+    if $remove == 'true' {
+        exec { '/sbin/ifdown tun6to4':
+            before => Augeas['tun6to4'],
         }
+    }
 
-        # Use augeas
-        augeas { 'tun6to4':
-            context => '/files/etc/network/interfaces/',
-            changes => $augeas_cmd,
-        }
+    # Use augeas
+    augeas { 'tun6to4':
+        context => '/files/etc/network/interfaces/',
+        changes => $augeas_cmd,
+    }
 
-        if $remove != 'true' {
-            exec { '/sbin/ifup tun6to4':
-                require => Augeas['tun6to4'],
-            }
+    if $remove != 'true' {
+        exec { '/sbin/ifup tun6to4':
+            require => Augeas['tun6to4'],
         }
     }
 }
diff --git a/modules/interface/manifests/up_command.pp 
b/modules/interface/manifests/up_command.pp
index 19d2ce2..2a2db67 100644
--- a/modules/interface/manifests/up_command.pp
+++ b/modules/interface/manifests/up_command.pp
@@ -1,10 +1,8 @@
 define interface::up_command($interface, $command) {
-    if $::lsbdistid == 'Ubuntu' and versioncmp($::lsbdistrelease, '10.04') >= 
0 {
-        # Use augeas to add an 'up' command to the interface
-        augeas { "${interface}_${title}":
-            context => "/files/etc/network/interfaces/*[. = '${interface}']",
-            changes => "set up[last()+1] '${command}'",
-            onlyif  => "match up[. = '${command}'] size == 0";
-        }
+    # Use augeas to add an 'up' command to the interface
+    augeas { "${interface}_${title}":
+        context => "/files/etc/network/interfaces/*[. = '${interface}']",
+        changes => "set up[last()+1] '${command}'",
+        onlyif  => "match up[. = '${command}'] size == 0";
     }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/178484
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb5f1761c63971f0d6320c3f8631b3857a325de2
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <fai...@wikimedia.org>
Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org>
Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to