Mark Bergsma has submitted this change and it was merged.
Change subject: Rename ::interface to ::interface::ip
......................................................................
Rename ::interface to ::interface::ip
Change-Id: Id5c079f7b89e358a89d7408bb57a3ea801f692c7
---
M modules/interface/manifests/add_ip6_mapped.pp
M modules/interface/manifests/init.pp
A modules/interface/manifests/ip.pp
3 files changed, 21 insertions(+), 21 deletions(-)
Approvals:
Mark Bergsma: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/interface/manifests/add_ip6_mapped.pp
b/modules/interface/manifests/add_ip6_mapped.pp
index d238bcd..dbad5bc 100644
--- a/modules/interface/manifests/add_ip6_mapped.pp
+++ b/modules/interface/manifests/add_ip6_mapped.pp
@@ -20,7 +20,7 @@
$ipv6_address = inline_template("<%= require 'ipaddr';
(IPAddr.new(scope.lookupvar(\"::ipaddress6_${intf}\")).mask(64) |
IPAddr.new(ip4_address.gsub('.', ':'))).to_s() %>")
- interface { $title:
+ interface::ip { $title:
interface => $intf,
address => $ipv6_address,
prefixlen => "64"
diff --git a/modules/interface/manifests/init.pp
b/modules/interface/manifests/init.pp
index 0ee9f2b..e69de29 100644
--- a/modules/interface/manifests/init.pp
+++ b/modules/interface/manifests/init.pp
@@ -1,20 +0,0 @@
-# Expects address without a length, like address => "208.80.152.10", prefixlen
=> "32"
-define interface($interface, $address, $prefixlen="32") {
- $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";
- }
- }
-
- # Add the IP address manually as well
- exec { $ipaddr_command:
- path => "/bin:/usr/bin",
- returns => [0, 2]
- }
-}
diff --git a/modules/interface/manifests/ip.pp
b/modules/interface/manifests/ip.pp
new file mode 100644
index 0000000..78a03a7
--- /dev/null
+++ b/modules/interface/manifests/ip.pp
@@ -0,0 +1,20 @@
+# Expects address without a length, like address => "208.80.152.10", prefixlen
=> "32"
+define interface::ip($interface, $address, $prefixlen="32") {
+ $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";
+ }
+ }
+
+ # Add the IP address manually as well
+ exec { $ipaddr_command:
+ path => "/bin:/usr/bin",
+ returns => [0, 2]
+ }
+}
--
To view, visit https://gerrit.wikimedia.org/r/77097
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id5c079f7b89e358a89d7408bb57a3ea801f692c7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mark Bergsma <[email protected]>
Gerrit-Reviewer: Mark Bergsma <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits