Hi
On 15.07.2012, at 00:30, Peter Bukowinski wrote:

> On Jul 14, 2012, at 5:19 PM, loki77 <lok...@gmail.com> wrote:
> 
>> Hi, I'm trying to install the 'unbound' dns resolver in ubuntu via
>> puppet and I'm running into some issues.  The issue isn't that the
>> package doesn't install, but rather that apt automatically starts the
>> daemon - and when the daemon starts, it updates resolv.conf in a way
>> that breaks DNS.
>> 
>> There's a command, 'resolvconf --disable-updates' that will stop
>> unbound from making the change it wants to.  What I'd like to do is:
>> 
>> - If unbound isn't installed, then execute --disable-updates
>> - Then install unbound
>> - Then --enable-updates
>> 
>> Is there anyway to do this?  Thanks.
> 
> You can either write a custom fact that gets set when unbound is 
> installed/active and use that in an if block around the stop-install-start 
> procedure, or use the 'resolvconf --disable-updates' exec resource's 'unless' 
> parameter to test for a running unbound daemon prior to installing the 
> package.


You can use require and notify within the package resource to run exec 
statements.

e.g. (untested)

exec { 'disable':
        command => '/path/to/resolvconf --disable-updates',
        onlyif => 'dpkg -l | grep -c unbound | wc -l',
}
exec { 'enable':
        command => '/path/tp/resolvconf --enable-updates',
        unless => 'dpkg -l | grep -c unbound | wc -l',
}
package { 'unbound':
        requires => Exec['disable'],
        notify => Exec['enable'],
}

- Martin

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to