0
votes

I am playing around with puppet and am trying to copy a file from my local directory (my laptop) on to my puppet agent. I have two VM's running, one is puppet master and one is puppet agent. I looked up at this answer here but it seems like it was an older version on puppet. I am running puppet 3.4.3 . I have gone through the pro puppet book and the puppet tutorials but find them way to confusing (the former having very glaring typos). It would be BIG help if someone helped me out with the process in simple steps. This is what I have till now.

I created a folder named my_module in /etc/puppet/. In /etc/puppet/my_module is created two folders files, manifests and a file init.pp .

Init.pp looks like this:

class myfile {

    file { "/home/me/myfolder/file.py":
        mode => "0440",
        owner => 'root',
        group => 'root',
        source => 'puppet:///modules/module_name/datas.xls',
    }
}

I then copied the file file.py to the files folder I created above. I am unsure how to proceed after this step. Any help?

1

1 Answers

1
votes

please read this documentation regarding creating your own modules. The module you created is in the wrong location right now. Should be /etc/puppet/modules or wherever the modulepath in /etc/puppet/puppet.conf points to on the puppet master.

The file given with source => 'puppet:///modules/module_name/datas.xls' is the one which will be placed in /home/me/myfolder/file.py on the client where you run the puppet agent -t command to rollout your changes.

Another good source for examples how to use the standard builtin puppet features is Type Reference of puppetlabs.