Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Puppet for Windows Server

You're reading from   Learning Puppet for Windows Server Organize your Windows environment using Puppet tools to unload administrative burdens in a short time!

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher Packt
ISBN-13 9781785281877
Length 234 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Fuat Ulugay Fuat Ulugay
Author Profile Icon Fuat Ulugay
Fuat Ulugay
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Installing Puppet Server and Foreman FREE CHAPTER 2. Installing Puppet Agents 3. Your First Modules 4. Puppet Forge Modules for Windows 5. Puppet Facts, Functions, and Templates 6. Using Puppet for Windows Security 7. Reporting and Monitoring 8. Installing Software and Updates Index

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image