jms1
08/04/2025, 8:11 PMfile resource, is there a shortcut to include the name of the file being declared, as part of the source attribute's value? i'm thinking something like ...
file { '/etc/xyz' :
ensure => file ,
source => "puppet:///modules/${module_name}${SOMETHING}" ,
}jms1
08/04/2025, 8:12 PMfiles/etc/xyz file in itbastelfreak
08/04/2025, 8:14 PM$title and $name probably refer to the class name where the resource lives, not the resource title, but worth a tryjms1
08/04/2025, 8:18 PMjms1
08/04/2025, 8:18 PM$title only exists within the scope of a defined type, not a class.bastelfreak
08/04/2025, 8:19 PMvchepkov
08/04/2025, 8:21 PM['/etc/xyz'].each | $f | {
file { $f :
ensure => file ,
source => file("${module_name}${f}"),
}
}bastelfreak
08/04/2025, 8:22 PMjms1
08/04/2025, 8:24 PMsource => ... line that i could copy and paste all over the code base, without ever needing to manually adjust the path in the source attribute's value. it would cut down on human error (not least of which is my own)vchepkov
08/04/2025, 8:25 PMjms1
08/04/2025, 8:28 PMbastelfreak
08/04/2025, 8:29 PMvchepkov
08/04/2025, 8:30 PMvchepkov
08/04/2025, 8:30 PMjms1
08/04/2025, 8:31 PMhelindbe
08/06/2025, 9:25 PM