Mar 8, 2012
tom

Cannot install mailman with Puppet if maillist is also specified

Question

package { 'mailman':
  ensure  => installed,
  require => Package['exim4'],
}
maillist { 'mailman':
  ensure      => 'present',
  admin       => $admin,
  description => 'Site list',
  password    => $master_password,
  require     => Package['mailman'],
}

If package “mailman” has not been installed, then puppet complains that it “Could not find a default provider for maillist”. It seems it considers this to be an error in the manifest, because it aborts entirely and does not apply any configuration. As a result, it does not process the “package { ‘mailman': … }” directive, which means it does not install mailman. I need to comment out the maillist directive, then apply the configuration so that mailman is installed, then uncomment and reapply. But this is not satisfactory.

How can I do it in a better way?

Answer

There was a fix in Puppet 2.7.8, for issue #6907 that enables a provider to be installed or synchronised during the run that it’s being used in (subject to normal dependencies being specified). See the 2.7.8 release notes too.

You should find it fixes this case, allowing you to install the Mailman dependency for the maillist provider during the same run.

Answered by m0dlx

No related posts.

Leave a comment