Delete that "include ssh" line in the default node! That should make
it work the way you expect.

(You don't have a class named "ssh", which is what include is looking
for; instead, you have a defined type called "ssh." The way nodes.pp
is written now, it's trying to declare both class ssh and an instance
of the ssh type.)

On Feb 12, 2:06 pm, Andrey Ageyev <a.age...@gmail.com> wrote:
> Hi everyone,
>
> I'm learning Puppet and I want to configure ssh server with different
> port on different nodes.
>
> Puppet v2.7.1
>
> I have created module ssh:
>
> content of modules/ssh/manifests/install.pp
>
> class ssh::install {
>         package { "ssh":
>                 ensure => present,
>         }
>
> }
>
> content of modules/ssh/manifests/service.pp
> class ssh::service {
>         service { "ssh":
>                 ensure     => running,
>                 hasstatus  => true,
>                 hasrestart => true,
>                 enable     => true,
>                 require    => Class["ssh::config"],
>         }}
>
> content of modules/ssh/manifests/config.pp
>
> define ssh::config( $port = 22 ) {
>         file { "/etc/ssh/sshd_config":
>                 ensure  => present,
>                 owner   => 'root',
>                 group   => 'root',
>                 mode    => 0600,
>                 content => template("ssh/sshd_config.erb"),
>                 require => Class["ssh::install"],
>                 notify  => Class["ssh::service"],
>         }
>
> }
>
> modules/ssh/manifests/init.pp
> define ssh($port = 22){
>         include ssh::install, ssh::service
>         ssh::config{puppet: port => $port}
>
> }
>
> And in the nodes.pp:
>
> node default {
>         include ssh
>         ssh{ puppet: port => 3536 }
>
> }
>
> When I run
> puppet agent --no-daemonize --verbose --onetime
> I got:
> err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Could not find class ssh for pclient.testlab.dev at /etc/
> puppet/manifests/nodes.pp:2 on node pclient.testlab.dev
>
> Tell me, please, how to pass parameter to the class from node?
>
> Thanks,
> Andrey.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to