Create the file
/usr/local/bin/pull-updates
with the following contents:#!/bin/sh PUPPETDIR=/home/git/puppet cd ${PUPPETDIR} git pull && sudo /usr/local/bin/papply
Create the file
/usr/local/bin/papply
with the following contents:#!/bin/sh PUPPETDIR=/home/git/puppet /usr/bin/puppet apply --modulepath ${PUPPETDIR}/modules ${PUPPETDIR}/manifests/site.pp
Set execute permissions on both scripts:
ubuntu@demo2:~$ sudo chmod a+x /usr/local/bin/pull-updates ubuntu@demo2:~$ sudo chmod a+x /usr/local/bin/papply
Edit the
sudoers
file:ubuntu@demo2:~$ sudo visudo
Add the following line to give
git
permission to run thepapply
script as root:git ALL = (root) NOPASSWD: /usr/local/bin/papply
Test that
git
can run thepapply
script:git@demo2:~$ sudo papply Notice: Finished catalog run in 1.88 seconds
Test that
git
can run thepull-updates
script:git@demo2:~$ pull-updates Already up-to-date. Notice: Finished catalog run in 1.80 seconds...
Puppet 3: Beginner's Guide
By :
Puppet 3: Beginner's Guide
By:
Overview of this book
<p>Everyone's talking about Puppet, the open-source DevOps technology that lets you automate your server setups and manage websites, databases, and desktops. Puppet can build new servers in seconds, keep your systems constantly up to date, and automate daily maintenance tasks. <br /><br />"Puppet 3 Beginner's Guide" gets you up and running with Puppet straight away, with complete real world examples. Each chapter builds your skills, adding new Puppet features, always with a practical focus. You'll learn everything you need to manage your whole infrastructure with Puppet.<br /><br />"Puppet 3 Beginner’s Guide" takes you from complete beginner to confident Puppet user, through a series of clear, simple examples, with full explanations at every stage.</p>
<p>Through a series of worked examples introducing Puppet to a fictional web company, you'll learn how to manage every aspect of your server setup. Switching to Puppet needn't be a big, long-term project; this book will show you how to start by bringing one small part of your systems under Puppet control and, little by little, building to the point where Puppet is managing your whole infrastructure.</p>
<p>Presented in an easy-to-read guide to learning Puppet from scratch, this book explains simply and clearly all you need to know to use this essential IT power tool, all the time applying these solutions to real-world scenarios.</p>
Table of Contents (17 chapters)
Puppet 3 Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Introduction to Puppet
First steps with Puppet
Packages, Files, and Services
Managing Puppet with Git
Managing users
Tasks and templates
Definitions and Classes
Expressions and Logic
Reporting and troubleshooting
Moving on Up
Index
Customer Reviews