From a0f5ebde8acee178afa111e2c3df4a159bc66a98 Mon Sep 17 00:00:00 2001 From: Nate Riffe Date: Fri, 22 May 2015 07:49:36 -0500 Subject: [PATCH] Make `ensure => absent` work again The incremental update change made NS record updates work for non-glue NS records, but broke `ensure => absent` because there is no semantic guarantee that the contents of the `data` member match what's in DNS. Set math ensures that hilarity ensues. --- lib/puppet_bind/provider/nsupdate.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet_bind/provider/nsupdate.rb b/lib/puppet_bind/provider/nsupdate.rb index a58c6ed..1a1b3ef 100644 --- a/lib/puppet_bind/provider/nsupdate.rb +++ b/lib/puppet_bind/provider/nsupdate.rb @@ -83,11 +83,11 @@ module PuppetBind end def rrdata_adds - newdata - rrdata + resource[:ensure] === :absent ? [] : newdata - rrdata end def rrdata_deletes - type === 'SOA' ? [] : rrdata - newdata + resource[:ensure] === :absent ? rrdata : (type === 'SOA' ? [] : rrdata - newdata) end def server