Hi,
If you have put you class in one big, you will get this error.
Every class must have its own pp file
modules/ssh/manisfests/init.pp (class ssh)
install.pp (class ssh::init)
config.pp (class ssh::config)
and so on
more info :
http://docs.puppetlabs.com/puppet/2.7/reference/lang_namespaces.html
hth
Grts
Jo
On 01/16/2014 06:25 AM, Tim Dunphy wrote:
Hi All,
I'm writing to you today because I am attempting to follow along in
the "Pro Puppet" book I am attempting the ssh module example from page 39.
I am getting the following error on the client when I try to implement it:
[root@beta:~] #puppet agent --test --server puppet.mydomain.com
<http://puppet.mydomain.com>
info: Caching catalog for beta.mydomain.com <http://beta.mydomain.com>
err: Failed to apply catalog: Could not find dependency
Class[Ssh:install] for File[/etc/ssh/sshd_config] at
/etc/puppet/modules/ssh/manifests/init.pp:16
This is the class I have defined on the puppet server:
class ssh::install {
package { "openssh":
ensure => present,
}
}
class ssh::config {
file { "/etc/ssh/sshd_config":
ensure => present,
owner => 'root',
group => 'root',
mode => 0600,
source => "puppet:///modules/ssh/sshd_config",
require => Class["ssh:install"],
notify => Class["ssh::service"],
}
}
class ssh::service {
service { "sshd":
ensure => running,
hasstatus => true,
hasrestart => true,
require => Class["ssh::config"],
}
}
class ssh {
include ssh::install, ssh::config, ssh::service
}
And this is the definition I tried to copy from the book:
class ssh::install {
package { "openssh":
ensure => present,
}
}
class ssh::config {
file { "/etc/ssh/sshd_config":
ensure = > present,
owner => 'root',
group => 'root',
mode => 0600,
source => "puppet:///modules/ssh/sshd_config",
require => Class["ssh::install"],
notify => Class["ssh::service"],
}
}
class ssh::service {
service { "sshd":
ensure => running,
hasstatus => true,
hasrestart => true,
enable => true,
require => Class["ssh::config"],
}
}
class ssh { include ssh::install, ssh::config, ssh::service }
However I can't tell what the differences are that prevent the version
I keyed in from working. I've even created a diff of the two files
with the same order of files that you see above (mine first , theirs
second)
[root@beta:~] #cat ssh_diff.txt
1,5c1,5
< class ssh::install {
< package { "openssh":
< ensure => present,
< }
< }
---
> class ssh::install {
> package { "openssh":
> ensure => present,
> }
> }
7,17c7,17
< class ssh::config {
< file { "/etc/ssh/sshd_config":
< ensure => present,
< owner => 'root',
< group => 'root',
< mode => 0600,
< source => "puppet:///modules/ssh/sshd_config",
< require => Class["ssh:install"],
< notify => Class["ssh::service"],
< }
< }
---
> class ssh::config {
> file { "/etc/ssh/sshd_config":
> ensure = > present,
> owner => 'root',
> group => 'root',
> mode => 0600,
> source => "puppet:///modules/ssh/sshd_config",
> require => Class["ssh::install"],
> notify => Class["ssh::service"],
> }
> }
19,26d18
< class ssh::service {
< service { "sshd":
< ensure => running,
< hasstatus => true,
< hasrestart => true,
< require => Class["ssh::config"],
< }
< }
28c20,30
< class ssh { include ssh::install, ssh::config, ssh::service }
---
> class ssh::service {
> service { "sshd":
> ensure => running,
> hasstatus => true,
> hasrestart => true,
> enable => true,
> require => Class["ssh::config"],
> }
> }
>
> class ssh { include ssh::install, ssh::config, ssh::service }
Could I possibly borrow a fresh pair of eyeballs that might be able
to recognize what's wrong?
Thanks
--
GPG me!!
gpg --keyserver pool.sks-keyservers.net
<http://pool.sks-keyservers.net> --recv-keys F186197B
--
You received this message because you are subscribed to the Google
Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/CAOZy0emB1akVKkMv8S5gmtBs_0fatv0E%3DApvh65KhU%3DFtzKxnA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Johan De Wit
Open Source Consultant
Red Hat Certified Engineer (805008667232363)
Puppet Certified Professional 2013 (PCP0000006)
_________________________________________________________
Open-Future Phone +32 (0)2/255 70 70
Zavelstraat 72 Fax +32 (0)2/255 70 71
3071 KORTENBERG Mobile +32 (0)474/42 40 73
BELGIUM http://www.open-future.be
_________________________________________________________
Next Events:
Puppet Fundamentals Training |
http://www.open-future.be/puppet-fundamentals-training-4-till-6th-february
Puppet Intruction Course |
http://www.open-future.be/puppet-introduction-course-7th-february
Zabbix Certified Training |
http://www.open-future.be/zabbix-certified-training-10-till-12th-february
Zabbix for Large Environments Training |
http://www.open-future.be/zabbix-large-environments-training-13-till-14th-february
Subscribe to our newsletter | http://eepurl.com/BUG8H
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/52D796B9.6050403%40open-future.be.
For more options, visit https://groups.google.com/groups/opt_out.