Ask Your Question
0

"Could not find dependency Package" question

asked 2015-06-03 13:59:39 -0500

lamazing gravatar image

I’m running into this dependency error:

err: Failed to apply catalog: Could not find dependency Package[nscd] for Service[nscd] at /etc/puppet/modules/system/manifests/nscd/new.pp:9

Does Puppet just do a "yum info" to determine if a dependency is installed? When I comment out the require in new.pp, Puppet no longer errors. Could anyone shed some light on it? Thanks!

This is from the Puppet client

[root@puppet_client ~]# puppet agent -vt
info: Caching catalog for server
err: Failed to apply catalog: Could not find dependency Package[nscd] for Service[nscd] at /etc/puppet/modules/system/manifests/nscd/new.pp:9

This is from the Puppet master

-bash-4.1# cat new.pp 
class system::nscd::new {

service { "nscd": 
    enable     => true,
    ensure     => running,
    restart    => "/usr/local/bin/nscd-restart",
    hasstatus  => true,
    require    => [ Package['nscd'], File['nscd-restart'] ],
}

file { "nscd-conf":
    path    => "/etc/nscd.conf",
    ensure  => present,
    content => template("system/nscd.conf.$erb"),
    mode    => 644, owner => root, group => 0,
    notify  => Service['nscd'],
}

file { "nscd-restart":
    path    => "/usr/local/bin/nscd-restart",
    content => template("system/nscd-restart.erb"),
    mode    => 655,
}

}

This is on the Puppet client

[root@puppet_client eric_lam]# yum info nscd
Installed Packages
Name        : nscd
Arch        : x86_64
Version     : 2.12
Release     : 1.149.el6_6.5
Size        : 176 k
Repo        : installed
From repo   : abc-appsupport6
Summary     : A Name Service Caching Daemon (nscd).
URL         : http://sources.redhat.com/glibc/
License     : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
Description : Nscd caches name service lookups and can dramatically improve
            : performance with NIS+, and may help with DNS as well.

This is on the Puppet master

-bash-4.1# yum info nscd
Installed Packages
Name        : nscd
Arch        : x86_64
Version     : 2.12
Release     : 1.47.el6_2.9
Size        : 163 k
Repo        : installed
Summary     : A Name Service Caching Daemon (nscd).
URL         : http://sources.redhat.com/glibc/
License     : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
Description : Nscd caches name service lookups and can dramatically improve
            : performance with NIS+, and may help with DNS as well.

Available Packages
Name        : nscd
Arch        : x86_64
Version     : 2.12
Release     : 1.149.el6_6.5
Size        : 223 k
Repo        : abc-appsupport6
Summary     : A Name Service Caching Daemon (nscd).
URL         : http://sources.redhat.com/glibc/
License     : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
Description : Nscd caches name service lookups and can dramatically improve
            : performance with NIS+, and may help with DNS as well.
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2015-06-03 21:47:02 -0500

csharpsteen gravatar image

updated 2015-06-03 21:48:27 -0500

In new.pp you have defined a ncsd Service that depends on both a ncsd Package and a nscd-restart File:

service { "nscd": 
    ...
    require    => [ Package['nscd'], File['nscd-restart'] ],
}

The ncsd-restart File is also defined in the manifest:

file { "nscd-restart":
    ....
}

However, there is no package { "ncsd": ... } present. The error message is saying that Puppet cannot sync the ncsd Service, because it depends on synching a ncsd Package which cannot be found in the catalog. To resolve this issue, either add a ncsd Package resource to the system::nscd::new class or include another class which declares the Package resource.

The fact that yum knows about a ncsd package doesn't really affect this situation --- as, in general, Puppet only knows about resources which are explicitly declared in a manifest.

edit flag offensive delete link more

Comments

Doh, thanks! I should have thought about that, haha.

lamazing gravatar imagelamazing ( 2015-06-05 16:07:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-06-03 13:59:39 -0500

Seen: 3,935 times

Last updated: Jun 03 '15