Re: [Puppet Users] ssh module dependency failure

2014-01-16 Thread Tim Dunphy
Hey guys,

OK, thanks! So I solved the type-o with the one ':' in the file definition
and separated the classes out into 4 different files:

showing init.pp

class ssh {  include ssh::install, ssh::config, ssh::service }


showing config.pp

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"],
  }


showing install.pp

class ssh::install {
 package { "openssh":
ensure => present,
  }
  }


And finally  showing service.pp

class ssh::service {
 service { "sshd":
 ensure => running,
 hasstatus => true,
 hasrestart => true,
 enable => true,
 require => Class["ssh::config"],
 }
   }
   }


They manifests are all located in the following directory with this
ownership and permissions:

root@puppet:/etc/puppet/modules/ssh/manifests] #ls -l
/etc/puppet/modules/ssh/manifests/
total 16
-rw-r--r-- 1 puppet puppet 395 Jan 16 10:00 config.pp
-rw-r--r-- 1 puppet puppet  63 Jan 16 09:59 init.pp
-rw-r--r-- 1 puppet puppet 104 Jan 16 10:00 install.pp
-rw-r--r-- 1 puppet puppet 191 Jan 16 10:01 service.pp

But now when I run the puppet command I get the following error saying that
puppet can't find the 'ssh class':


[root@beta:~] #puppet agent --test --server puppet.mydomain.com
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not find class ssh::install for beta.jokefire.com on node
beta.mydomain.com
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

This is how my node definitions look:

node 'base' {
 include  bash, sudo, puppet, ca
}

node 'webserver' inherits 'base' {
 include   web
}

node 'beta.mydomain.com' inherits 'webserver'  {
 include mysql, cassandra, mongo, memcached, proftpd, ssh
}

Any ideas why this error is now occurring?

Thanks
Tim


On Thu, Jan 16, 2014 at 12:55 AM, Andrea Cappelli wrote:

> Il 16/01/2014 06:25, Tim Dunphy ha scritto:
>
>> Hi All,
>>
>> []
>>
>>
>> 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
>> [...]
>>
>>
>> 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"],
>>  }
>> }
>>
>>
> Hi,
> I suppose you have to use require => Class["ssh::install"] instead of
> require => Class["ssh:install"] (double ::)
>
> HTH
>
> --
> Andrea Cappelli
>
>
> --
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/puppet-users/52D77454.1020906%40gmail.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
GPG me!!

gpg --keyserver 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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAOZy0emD5cmm8FzBYz1QmERX6%3DxdadsGRRfzzjCgsm2etJ4-eg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] ssh module dependency failure

2014-01-16 Thread Andrea Cappelli

Il 16/01/2014 06:25, Tim Dunphy ha scritto:

Hi All,

[]

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

[...]

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"],
 }
}



Hi,
I suppose you have to use require => Class["ssh::install"] instead of 
require => Class["ssh:install"] (double ::)


HTH

--
Andrea Cappelli

--
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/52D77454.1020906%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] ssh module dependency failure

2014-01-16 Thread Johan De Wit

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 


info: Caching catalog for 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 {

 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 {

 running,

 true,

 true,

 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 
 --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 puppet-users+unsubscr...@googlegroups.com.
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 E

[Puppet Users] ssh module dependency failure

2014-01-16 Thread Jose Luis Ledesma
I think the error is here: 

require => Class["ssh:install"]

Should be ssh::install

Regards

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/867220e8-2ca7-4089-875b-0540fd19941b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] ssh module dependency failure

2014-01-15 Thread Tim Dunphy
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
info: Caching catalog for 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 {

 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 {

 running,

 true,

 true,

 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 --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 puppet-users+unsubscr...@googlegroups.com.
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.