Issue #2719 has been updated by Geoff Crompton.

I think I have a more practical example. Given the following manifest on a 
debian system:

package { 'libnss-ldap':
 ensure => installed,
}
package {'nscd':
 ensure => absent,
}

The libnss-ldap package in Debian has a recommends dependancy on the nscd 
package. If you don't have either installed, on a Debian Lenny system puppet 
takes two transactions to settle to the wanted state, as the first run drags in 
the nscd package, but puppet doesn't notice:

geo...@chiraz:~$ sudo puppet tmp/puppet.pp 
notice: //Package[libnss-ldap]/ensure: created
geo...@chiraz:~$ sudo puppet tmp/puppet.pp 
notice: //Package[nscd]/ensure: removed
geo...@chiraz:~$ sudo puppet tmp/puppet.pp 
geo...@chiraz:~$ 

Even if you use the before or require metaparameters, you get the same result:
geo...@chiraz:~$ cat tmp/puppet.pp 
package { 'libnss-ldap':
  ensure => installed,
  before => Package['nscd'],
}
package {'nscd':
  ensure => absent,
}
geo...@chiraz:~$ sudo aptitude remove libnss-ldap nscd > /dev/null
geo...@chiraz:~$ sudo puppet tmp/puppet.pp 
notice: //Package[libnss-ldap]/ensure: created
geo...@chiraz:~$ sudo puppet tmp/puppet.pp 
notice: //Package[nscd]/ensure: removed
geo...@chiraz:~$ sudo puppet tmp/puppet.pp 
geo...@chiraz:~$ 


Note I'm running an older version of puppet

geo...@chiraz:~$ puppet --version
0.24.5

----------------------------------------
Bug #2719: package handling bug
http://projects.reductivelabs.com/issues/2719

Author: Klavs Klavsen
Status: Needs more information
Priority: Normal
Assigned to: 
Category: 
Target version: 
Affected version: 0.24.8
Keywords: 
Branch: 


I just found, that if remove a package, which has packages that depend on it 
(and are thusly removed when you remove the package) puppet doesn't notice, 
even though it is supposed to ensure the relevant packages are installed.

My case where I found it, envolves these rules:
<pre>
 package{"site-test":
    ensure => absent
  }
  @package{"site-prod":
    ensure => present,
    ensure => $sitever,
    require  => [Exec["apt-update"], Package["site-test"]]
  }
  @package{"site-utility":
    ensure => present,
    ensure => $sitever,
  require  => Exec["apt-update"]
  }
</pre>
(and then realize site-prod and site-utility somewhere).

I'm guessing that puppet checks for the existence of Package["site-utility"] 
before installing site-prod, and before removing "site-test" - and thus doesn't 
notice that the package system removes it when uninstalling "site-test".

The end result is that I had to run puppet twice, to have the package 
"site-utility" installed again.

Or perhaps there's some way to setup a correct dependency so this wouldn't 
happen, and I'm the bug?


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to