Uploading files

If you have a very long text file or a binary file, it really does not make sense to use the content option. In this case, we will directly refer to the file and it will be uploaded. Later, if we make any changes in our file in the server, this change will be also applied to all the hosts.

Here is the definition:

file { 'path and name of file':
source => 'puppet:///modules/modulename/filename',
}

We will, again, use the hello.txt file, but this time we will create the details under our module. For this purpose, create the files folder under the helloworld module. After this, create the hello.txt file under the files folder.

The module structure is as shown in the following screenshot, and we can also see the contents of the hello.txt ...

Get Learning Puppet for Windows Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.