BBlack has submitted this change and it was merged.
Change subject: ipv6 token stuff: add flush on first set, update comments
......................................................................
ipv6 token stuff: add flush on first set, update comments
Change-Id: Ie3a0c781318f856af7b89cd5b37aab895f0afd3d
---
M modules/interface/manifests/add_ip6_mapped.pp
1 file changed, 14 insertions(+), 7 deletions(-)
Approvals:
BBlack: 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 194c181..b0d625d 100644
--- a/modules/interface/manifests/add_ip6_mapped.pp
+++ b/modules/interface/manifests/add_ip6_mapped.pp
@@ -40,15 +40,22 @@
# used with any autoconf address, as opposed to one derived from the
# macaddr. This aligns the autoconf-assigned address with the fixed
# one set above, and can do so as a pre-up command to avoid ever
- # having another address even temporarily. We could probably rely on
- # this exclusively and drop the static address above, but the
- # redundancy doesn't hurt (the autoconf simply won't end up appearing
- # on the list at all when it duplicates the static address), and this
- # allays any fears about relying on router advertisments. As above,
- # this also executes itself in the present when first configured.
+ # having another address even temporarily, when this is all set up
+ # before boot.
+ # We can't rely on the token part exclusively, though, or we'd face
+ # race conditions: daemons would expect to be able to bind this
+ # address for listening immediately after network-up, but the address
+ # wouldn't exist until the next RA arrives on the interface, which can
+ # be 1-2s in practice.
+ # By keeping both the static config from above and the token command,
+ # we get the best of all worlds: no race, and no conflicting
+ # macaddr-based assignment on the interface either. When this is
+ # first applied at runtime it will execute the token command as well,
+ # but any previous macaddr-based address will be flushed.
if os_version('debian >= jessie || ubuntu >= trusty') {
$v6_token_cmd = "/sbin/ip token set $v6_mapped_lower64 dev ${intf}"
+ $v6_flush_dyn_cmd = "/sbin/ip -6 addr flush dev ${intf} dynamic"
$v6_token_check_cmd = "/sbin/ip token get dev $intf | grep -qw
$v6_mapped_lower64"
$v6_token_preup_cmd = "set iface[. = '${intf}']/pre-up
'${v6_token_cmd}'"
@@ -58,7 +65,7 @@
}
exec { "${intf}_v6_token":
- command => $v6_token_cmd,
+ command => "$v6_token_cmd && $v6_flush_dyn_cmd",
unless => $v6_token_check_cmd,
}
}
--
To view, visit https://gerrit.wikimedia.org/r/214334
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3a0c781318f856af7b89cd5b37aab895f0afd3d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits