Ben Ford wrote:
> 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
That helped, thanks:
$filesConfd0640 = [
"99-status.conf",
]
$filesConfd0640.each |String $file| {
file { "${apacheConfPath}/conf-available/${file}":
mode => '0640',
owner => $rootUID,
group => $rootGID,
content => epp("${module_name}/etc/apache2/conf.d/${file}.epp",
{ apacheCfg => $apacheCfg, apacheConfPath => $apacheConfPath }),
notify => Exec['/usr/local/bin/apache.sh -c restart']
}
exec { "a2enconf ${file}":
path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin',
refreshonly => true,
command => "a2enconf ${file}",
subscribe => File["${apacheConfPath}/conf-available/${file}"],
}
}