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

You're reading from   LEARNING PUPPET Build intelligent software stacks with the Puppet configuration management suite

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher
ISBN-13 9781784399832
Length 304 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Puppet Development in Isolation FREE CHAPTER 2. Managing Packages in Puppet 3. My First Puppet Module 4. Monitoring Your Web Server 5. Load Balancing the Cluster 6. Scaling Up the Puppet Environment 7. Making the Configuration Dynamic 8. Extending Puppet 9. The Puppet Enterprise Console 10. Troubleshooting Puppet Index

Managing resources with the puppet apply command

We can apply this resource to the --execute (or -e) puppet apply command, which will remove the user Elisa from the system.

As Elisa no longer exists in the system, let's change the ensure attribute value to 'present' so that Puppet can create the user Elisa:

puppet apply --execute "user { 'Elisa':  ensure => 'present', }"

Puppet will display the following output on the screen:

Managing resources with the puppet apply command

As you might have noticed, the output of the puppet apply command looks different from the puppet resource command that we used earlier to create user Elisa. Let's examine the output line by line:

  • Line 1: Notice: Compiled catalog for learning.puppetlabs.vm in environment production in 0.12 seconds

    The Puppet report shows that the manifest was compiled successfully in 0.12 seconds. The manifest was compiled for the learning.puppetlabs.vm Puppet host. The learning.puppetlabs.vm Puppet host is a member of the Puppet environment called production.

  • Line 2: Notice: /Stage[main]/Main/User[Elisa]/ensure: created

    The Puppet report shows that the user Elisa was created successfully on the system.

  • Line 3: Notice: Finished catalog run in 0.22 seconds

    The Puppet report shows that the Puppet run was completed successfully in 0.22 seconds.

The preceding three lines relate to the following different stages of the Puppet run:

  1. Before Puppet can apply the manifest or a set of manifests, it performs an operation where it compiles a catalogue. A catalogue is a collection of Puppet manifests. During the compilation stage, Puppet looks for possible errors in the manifest files and ensures that the manifests were correctly formatted.
  2. Once the catalogue is compiled, Puppet moves on to the second stage where it applies the catalogue to the system.
  3. The last step of the process is to produce a report of the results of the Puppet run.
You have been reading a chapter from
LEARNING PUPPET
Published in: Aug 2015
Publisher:
ISBN-13: 9781784399832
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