Puppet Master Error 400 on SERVER: Invalid parameter path at /etc/puppet/manifests/site.pp

1

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", }
}

Bhagavan

Posted 2017-01-10T07:18:41.553

Reputation: 11

Answers

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", }

Dominic Cleal

Posted 2017-01-10T07:18:41.553

Reputation: 196