1

How do I pass file name as arguments to puppet class? My manifest file is

class new_file ($my_filename){
    file { $my_filename:
        ensure => present,
        content => "I got it, Hello, I am Aura, with new content\n",
    }
}

node 'agent1' {
  class {new_file: path => "/tmp/t.txt", }
}

1 Answer 1

1

Your class accepts a parameter called my_filename:

class new_file ($my_filename){

But here you're supplying path:

class {new_file: path => "/tmp/t.txt", }

Change this parameter to the same name and it will prevent the invalid parameter path error:

class {new_file: my_filename => "/tmp/t.txt", }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .