problem with File[path]

18 views
Skip to first unread message

Peter Romfeld

unread,
Feb 5, 2014, 11:39:09 PM2/5/14
to puppet...@googlegroups.com
hi,

i get the following error:

Parameter path failed on File[${nagiospluginsdir}/${pname}]: File paths must be fully qualified, not '${nagiospluginsdir}/${pname}'

plugin.pp:

define nrpeplugins::plugin(
  $nagiospluginsdir = $nrpeplugins::params::nagiospluginsdir,
  $nrpepluginsdir = $nrpeplugins::params::nrpepluginsdir,
  $nrpeservice = $nrpeplugins::params::nrpeservice,
  $pname = $title
) {

  file { '${nrpepluginsdir}/${pname}.cfg':
#  file { 'newnrpe':
#    path => '${nrpepluginsdir}/${pname}.cfg',
    ensure => file,
    owner => root,
    group => root,
    mode => '0644',
    content => template('nrpeplugins/nrped.erb'),
    notify => Service['${nrpeservice}']
  }

  file { '${nagiospluginsdir}/${pname}':
#  file { 'newscript':
#    path => '${nagiospluginsdir}/${pname}',
    ensure => file,
    owner => root,
    group => root,
    mode => '0755',
    source  => 'puppet:///modules/nrpeplugins/${pname}'
  }

}

thanks,
peter

Peter Bukowinski

unread,
Feb 5, 2014, 11:47:42 PM2/5/14
to puppet...@googlegroups.com
You're getting the error because you've used single quotes in the file definition. If you want puppet to interpret variables when it compiles the catalog, you must use double quotes.

--
Peter Bukowinski

Peter Romfeld

unread,
Feb 5, 2014, 11:50:48 PM2/5/14
to puppet...@googlegroups.com
wow thanks so much for the fast answer!
im used from python that single or double quote means the same :)



--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/A2EE8146-86B7-4184-8C0D-919982890F0B%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages