Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Puppet Cookbook - Third Edition
  • Toc
  • feedback
Puppet Cookbook - Third Edition

Puppet Cookbook - Third Edition

By : Thomas Uphill, John Arundel
5 (2)
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
11
Index

Using exported host resources


In the previous example, we used the spaceship syntax to collect virtual host resources for hosts of type database or type web. You can use the same trick with exported resources. The advantage to using exported resources is that as you add more database servers, the collector syntax will automatically pull in the newly created exported host entries for those servers. This makes your /etc/hosts entries more dynamic.

Getting ready

We will be using exported resources. If you haven't already done so, set up puppetdb and enable storeconfigs to use puppetdb as outlined in Chapter 2, Puppet Infrastructure.

How to do it...

In this example, we will configure database servers and clients to communicate with each other. We'll make use of exported resources to do the configuration.

  1. Create a new database module, db:

    t@mylaptop ~/puppet/modules $ mkdir -p db/manifests
    
  2. Create a new class for your database servers, db::server:

    class db::server {
      @@host {"$::fqdn":
        host_aliases...
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