Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Puppet

You're reading from   Mastering Puppet Mastering Puppet for network programming enables developers to pull the strings of Puppet and configure enterprise-level environments for optimum performance

Arrow left icon
Product type Paperback
Published in Jul 2014
Publisher
ISBN-13 9781783982189
Length 280 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Thomas Uphill Thomas Uphill
Author Profile Icon Thomas Uphill
Thomas Uphill
Arrow right icon
View More author details
Toc

Custom facts

While managing a complex environment, facts can be used to bring order out of chaos. If your manifests have large case statements or nested if statements, a custom fact may help reduce the complexity or allow you to change your logic.

When you work in a large organization, keeping the number of facts to a minimum is important as several groups may be working on the same system and thus interaction between users may adversely affect one another's work or they may find it difficult to understand how everything fits together.

As we have already seen in the previous chapter, if our facts are simple text values that are node specific, we can just use stdlib's facts.d directory to create static facts that are node specific.

This facts.d mechanism is included by default on facter Versions 1.7 and higher, and they are referred to as external facts.

Creating custom facts

We will be creating some custom facts, so we will create our Ruby files in the module_name/lib/facter directory...

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 €18.99/month. Cancel anytime