i tried to create a file hello.txt. if I have the following contents in the init.pp and run, i get my desired result i.e a file named hello.txt with the contents.
file { 'D:/puppet/hello.txt':
ensure => present,
content => 'Hello World \n',
}
but if I try to create a class,
class createfile ($path = "D:/puppet/",){
file { '$path/hello.txt':
ensure => present,
content => 'Hello World \n',
}
}
the puppet says the catalog is complied, doesn't give me any error but still doesn't create a file.
↧