Sure. When you make a reference (the upper case File syntax), it has to point to a thing that exists. The reference is a resource type (File) and a resource title (99-status.conf), but you've not defined a resource with that title. Basically, it's like making a symlink to a file that doesn't exist. To fix it, you just need to change your code so the reference and the resource title agree on a title.
Read more about relationships at https://puppet.com/docs/puppet/5.5/lang_relationships.html and about the reference syntax at https://puppet.com/docs/puppet/5.5/lang_data_resource_reference.html On Thu, Dec 20, 2018 at 8:56 AM Helmut Schneider <[email protected]> wrote: > Hi, > > I want to exec something with a variable. If found the following link > and tried to implement: > > > https://stackoverflow.com/questions/33557093/puppet-notify-a-class-with-parameters > > file { "${apacheConfPath}/conf-available/${file}": > mode => '0640', > owner => $rootUID, > group => $rootGID, > source => > > "puppet:///modules/my_apache/${operatingsystem}/${apacheConfPath}/conf.d/${file}", > # notify => a2enmod["$file"], > # notify => a2enmod['99-status.conf'], > } > exec { "a2enconf_${title}": > path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin', > refreshonly => true, > command => "a2enconf ${title}", > # subscribe => File['99-status.conf'], > subscribe => File["$file"], > } > > Error: Failed to apply catalog: Could not find dependency > File[99-status.conf] for Exec[a2enconf_my_apache::config_files] at > /etc/puppetlabs/code/modules/my_apache/manifests/config_files.pp:130 > > Can someone point me to the right direction? > > Thank you! > > -- > 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/xn0lixerc48gqno000%40news.gmane.org > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CACkW_L72V-VAmPWFZ%3DvMJOYts0RdTiDR0GRssS%3Dw1Md70%2BRimQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
