Ask Your Question

Could not find dependency Package[openssh-server] for Service[sshd]

asked 2016-02-26 08:44:43 -0500

xeon65 gravatar image

I'm trying to figure out why I get this error when checking for the openssh-server package: Could not find dependency Package[openssh-server] for Service[sshd]

I'm using a line like this to check the package on CentOS 7: require => Package['openssh-server'],

I do have the package installed: rpm -q openssh-server openssh-server-6.6.1p1-23.el72.x8664

I've been looking all over the Internet to see how Puppet checks packages, but have come up short.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-02-26 11:57:02 -0500

xeon65 gravatar image

I found the solution, you have to put this in your class file for the package: package { 'openssh-server': name => "openssh-server", provider => "yum" }

edit flag offensive delete link more


package { 'openssh-server': } is sufficient enough.

rjc gravatar imagerjc ( 2016-03-05 14:03:23 -0500 )edit

answered 2016-02-26 13:21:25 -0500

lavaman gravatar image

Just to clarify, the dependency you specified is for a resource in the puppet code, not for something on the system you are applying the code on. Checking the system to see if the package is installed is an apply time activity, whereas checking resource dependencies is a parsing/compile time activity.

edit flag offensive delete link more


It's for a package on the system. The script checks to make sure the openssh-server is installed on the server.

xeon65 gravatar imagexeon65 ( 2016-02-26 13:53:51 -0500 )edit

I was just explaining why you had to add the package resource to solve your missing dependency issue.

lavaman gravatar imagelavaman ( 2016-02-27 18:46:04 -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


Asked: 2016-02-26 08:44:43 -0500

Seen: 215 times

Last updated: Feb 26 '16