I'm attempting to follow along in the puppet book with the ssh module lesson. I'm at the part where I'm attempting to use a variable that's been set in another class called ssh::params. When I run the puppet on the client I get the following error:
err: Failed to apply catalog: Parameter path failed on File[undef]: File paths must be fully qualified, not 'undef' at /etc/puppet/modules/ssh/manifests/config.pp:10
This is what my ssh modules directory looks like:
modules/ssh
├── files
│ └── sshd_config
├── manifests
│ ├── config.pp
│ ├── init.pp
│ ├── install.pp
│ ├── params.pp
│ └── service.pp
└── templates
Here is the definition I have setup in my config.pp manifest that is generating the error:
class ssh::config {
file { $ssh::params::ssh_service_config:
ensure => present,
owner => 'root',
group => 'root',
mode => 0600,
source => "puppet:///modules/ssh/sshd_config",
require => Class["ssh::install"],
notify => Class["ssh::service"],
}
}
The $ssh::params::ssh_service_config variable is what's throwing the undefined error when I run puppet on the client.
And this is my config.pp manifest in which that variable is defined:
class ssh::params {
case $operatingsystem {
Solaris: {
$ssh_package_name = 'openssh'
$ssh_service_config = '/etc/ssh/sshd_config'
$ssh_service_name = 'sshd'
}
/(Ubuntu|Debian)/: {
$ssh_package_name = 'openssh-server'
$ssh_service_config = '/etc/ssh/sshd_config'
$ssh_service_name = 'sshd'
}
/(RedHat|CentOS|Fedora)/: {
$ssh_package_name = 'openssh-server'
$ssh_service_config = '/etc/ssh/sshd_config'
$ssh_service_name = 'sshd'
}
}
}
I was hoping someone out there could help determine why this variable is undef?
Thanks,
Tim
--
GPG me!!
gpg --keyserver
pool.sks-keyservers.net --recv-keys F186197B