Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Puppet Cookbook - Third Edition
  • Table Of Contents Toc
  • Feedback & Rating feedback
Puppet Cookbook - Third Edition

Puppet Cookbook - Third Edition

By : Thomas Uphill, John Arundel
5 (2)
close
close
Puppet Cookbook - Third Edition

Puppet Cookbook - Third Edition

5 (2)
By: Thomas Uphill, John Arundel

Overview of this book

This book is for anyone who builds and administers servers, especially in a web operations context. It requires some experience of Linux systems administration, including familiarity with the command line, file system, and text editing. No programming experience is required.
Table of Contents (12 chapters)
close
close
11
Index

Adding external facts

The Creating custom facts recipe describes how to add extra facts written in Ruby. You can also create facts from simple text files or scripts with external facts instead.

External facts live in the /etc/facter/facts.d directory and have a simple key=value format like this:

message="Hello, world"

Getting ready

Here's what you need to do to prepare your system to add external facts:

  1. You'll need Facter Version 1.7 or higher to use external facts, so look up the value of facterversion or use facter -v:
    [root@cookbook ~]# facter facterversion
    2.3.0
    [root@cookbook ~]# facter -v
    2.3.0
    
  2. You'll also need to create the external facts directory, using the following command:
    [root@cookbook ~]# mkdir -p /etc/facter/facts.d
    

How to do it...

In this example, we'll create a simple external fact that returns a message, as shown in the Creating custom facts recipe:

  1. Create the file /etc/facter/facts.d/local.txt with the following contents:
    model=ED-209
  2. Run the following...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY