You are on page 1of 25

Automation

with Puppet
agus@btech.id
References
• https://puppet.com/docs/

• https://www.server-world.info/en/note?os=CentOS_7&p=puppet

• https://www.tutorialspoint.com/puppet/

2
Keywords
• Puppet • Resources
• Master • Facter
• Agent • Class
• Manifest • Ruby
• Infrastructure as code
• Module
• Nodes

3
Automation
with Puppet
Puppet Introduction
• https://www.youtube.com/watch?v=QFcqvBk1gNA

5
What is Puppet
• A software configuration management tool that run on various platform
(Unix-like systems, Microsoft windows, Mac, Solaris).

• Includes its own declarative language to describe system configuration


(Manifest)

• Using client-server paradigm to distribute compiled manifest (called


catalog) via encrypted communication (SSL)

6
Puppet Version History
• 2005 – founded – former CEO – Luke Kanies

• 2011 (feb) – first release, PE V.1 commercial product

• 2011 (sep) – PE V.2 – integration Mcollective

• 2013 (jun) – PE V.3 – rewrite engine, deprecated puppet Kick

• 2015 (jul) – PE 2015

• …..
https://puppet.com/misc/version-history
7
Puppet Opensource and Enterprise
Key differences:
• Web management tool
• Realtime reporting and event inspection
• Default instant push with MCollective
• Role based access control (RBAC)
• Node Management
• Enterprise Support (24/7)

https://puppet.com/products/why-puppet/puppet-enterprise-and-open-source-puppet
8
Puppet Support Lifecycle

https://puppet.com/misc/puppet-enterprise-lifecycle
9
What is Offered by Puppet
• Automatic provisioning
• Support various operating systems
• Human readable automation
• Uses SSL to securely communication between client and server
• Large and active user community and is being actively developed and supported,
for example puppetforge
• Many more in puppet enterprise

10
Operating Systems Supported by Puppet
• Linux: Debian, Ubuntu, Centos, RedHat, Fedora, Suse…
• Microsoft: Vista, Win 7, 8, 10, Server
• Mac
• Solaris
• IBM AIX
• Cisco: IOS-XR, NX-OS
• Ariesta EOS

11
How Puppet Works

12
Example of Puppet Usage
• Server deployment and configuration management

• Network device deployment and management

• Scaling up and down infrastructure based on configuration

13
Impact
• Simplifying deployment

• Faster mass deployment, management or adding new nodes

• Faster in updating state

• Clean configuration state versioning with version control (Git, SVN) – repo
based configuration

14
Pros n Cons (1)
Pros:
• Puppet is Open Source
• Allow resources abstraction
• Does a transaction only if needed (desired state)
• It’s cross platform
• The language is clean and easy
• Active community and development

15
Pros n Cons (2)
Cons:
• Rapid release and evolution, quite a task to keep up with the new features
• Close to programming
• Lack of default push system (Opensource version)
• Aren’t awesome at rolling back changes (on failures) and tracking artifacts

16
Puppet Key Elements
Puppet Manifest
All Puppet programs which are
built with an intension of creating
or managing any target host
machine. It’s written using Ruby
programming language and saved
with extension of .pp

18
Puppet Resources
Resource is an unit of puppet
mainly used for modeling and
maintaining system configuration.
Puppet resources list can be
shown using command:
puppet describe --list

19
Puppet Class and Module
Puppet classes are defined as a
collection of resources, which are
grouped together in order to get a
target node or machine in a desired
state. These classes are defined
inside Puppet manifest files which is
located inside Puppet modules.

20
Puppet Notify, Exec, Subscribe
Exec: executing command
Notify: calling a resource
Subscribe: reaction to changes

21
Fileserver
Distributing file from puppet master to agents

22
Lab 1
- Puppet architecture
- Installing puppet
- Puppet manifest
- Facter
- Conditional statement
- Node selection
- Using puppet module
23
Lab 2
- Create and using class
- Creating module
- Fileserver
- Using Git

24
Thanks

You might also like