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
file:
The next step now is to change our init.pp
file. The following are the details of the init.pp
file. Just be aware that we are not using the files
folder in the source definition:
As we have already imported the module class in Foreman, we...