I am new to Puppet - I have been playing around learning the basics. Most of the examples ( except the very basic ones ) that are on the puppet page do not work for me - either some dependency is missing or package is not found. I do not see the logs explaining what went wrong ( even if I run the --test or --verbose option)

  1. Can anyone clarify how does puppet manage to install any given package from a title ( for example starting from a manifest as below :

    class httpd {
          package { 'httpd':
               ensure => installed,

    Here - starting from 'httpd' - what happens when we run puppet apply on this manifest ? Where does it find the installer ( ie where is the repository - where is it configured ? )

  2. Specifically , I am getting this error :

    err: /Stage[main]/Ntp/Package[httpd]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install httpd' returned 1: Error: failure: repodata/filelists.xml.gz from base: [Errno 256] No more mirrors to try.
    You could try using --skip-broken to work around the problem
    You could try running: package-cleanup --problems
                           package-cleanup --dupes
                           rpm -Va --nofiles --nodigest

How can I fix this ?


It is trying to run yum to install httpd

 /usr/bin/yum -d 0 -e 0 -y install httpd

Try running that as root but I'm sure it will fail so try

 /usr/bin/yum clean all
 /usr/bin/yum -d 0 -e 0 -y install httpd

If that doesn't work your yum repositories are not working so you'll have to fix that file. Probably files in


While Mike's answer solves problem definitely - I would do similar thing through Puppet.

For example as a first step I would add following piece of code before installing any package

exec {'yum-clean-all':
  command =>  'yum clean all',
  path    =>  '/usr/bin',
  user    =>  'root',
  before  =>  Package[httpd],

Similarly any execution that needs to be done before installing packages should be executed through puppet as a first step.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.