Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

error in multiple file creation


I have written below code to create multiple file under /etc/dummy/manifests

class dummy::mulfil{

$filename = ["aaa","bbb","ccc"]

file {$filename:
ensure => 'file',
path => "/etc/dummy/manifests/${filename}"

need o/p like below


but I get below error

Failed to apply catalog: Cannot alias File[bbb] to ["/etc/dummy/manifestss/aaabbbccc"] at /etc/dummy/manifests/mulfil.pp:13; resource ["File", "/etc/dummy/manifests/aaabbbccc"] already declared at /etc/dummy/manifests/mulfil.pp:13

Also why its creating file name together "/etc/dummy/manifestss/aaabbbccc"