• Stars
    star
    145
  • Rank 254,144 (Top 6 %)
  • Language
    Puppet
  • License
    Other
  • Created over 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Puppet module to manage applications deployments and servers local management

Puppi: Puppet Knowledge to the CLI

Puppi is maintained by Example42 GmbH

Licence: Apache 2

Puppi is a unique tool that serves both as a Puppet module and a CLI command tool. It's data is entirely driven by Puppet code. Example use cases for Puppi may include:

  • creating a standardize method to automate the deployment of web applications
  • or to provide a set of standard commands to query and check system resources based on "user defined actions".

Its structure provides FULL flexibility on the type of "actions" that may be required for virtually any kind of application deployment and/or system information gathering.

The module provides:

  • Puppi v1 script

  • A set of scripts that can be chained together to automate any kind of deployment.

  • Puppet defines that make it easy to prepare a puppi set of commands for a project deployment.

  • Puppet defines to populate the output of the different actions.

This module requires functions provided by the Puppet Labs Stdlib Module.

HOW TO INSTALL

Download Puppi from GitHub and place it in your modules directory:

git clone https://github.com/example42/puppi.git /etc/puppet/modules/puppi

To use the Puppi just declare or include the puppi class

include puppi

If you have resources conflicts, do not install automatically the Puppi dependencies (commands and packages)

class { 'puppi':
  install_dependencies => false,
}

HOW TO USE

Once Puppi is installed you can use it to:

  • Easily define in Puppet manifests Web Applications deploy procedures. For example:

    puppi::project::war { "myapp":
      source           => "http://repo.example42.com/deploy/prod/myapp.war",
      deploy_root      => "/opt/tomcat/myapp/webapps",
    }
  • Integrate with your modules for puppi check, info and log

  • Enable Example42 modules integration

HOW TO USE WITH EXAMPLE42 MODULES

The Example42 modules version 1 provide (optional) Puppi integration. Once enabled for each module you have puppi check, info and log commands.

To enable Puppi integration in OldGen (version 1) Example42 Modules, set in the scope these variables:

$puppi = yes            # Enables puppi integration
$monitor = yes          # Enables automatic monitoring
$monitor_tool = "puppi" # Sets puppi as monitoring tool

USAGE OF THE PUPPI COMMAND (OLD GEN)

puppi <action> <project_name> [ -options ]

The puppi command has these possible actions:

First time initialization of the defined project (if available)

    puppi init <project>

Deploy the specified project

    puppi deploy <project>

Rollback to a previous deploy state

    puppi rollback <project>

Run local checks on system and applications

    puppi check

Tail system or application logs

    puppi log

Show system information (for all or only the specified topic)

    puppi info [topic]

Show things to do (or done) manually on the system (not done via Puppet)

    puppi todo

In the deploy/rollback/init actions, puppi runs the commands in /etc/puppi/projects/$project/$action, logs their status and then run the commands in /etc/puppi/projects/$project/report to provide reporting, in whatever, pluggable, way.

You can also provide some options:

  • -f : Force puppi commands execution also on CRITICAL errors

  • -i : Interactively ask confirmation for every command

  • -t : Test mode. Just show the commands that should be executed without doing anything

  • -d <yes|full>: Debug mode. Show debugging info during execution

  • -o "parameter=value parameter2=value2" : Set manual options to override defaults. The options must be in parameter=value syntax, separated by spaces and inside double quotes.

Some common puppi commands when you log for an application deployment:

puppi check
puppi log &    # (More readable if done on another window)
puppi deploy myapp
puppi check
puppi info myapp

THE PUPPI MODULE

The set of commands needed for each of these actions are entirely managed with specific Puppet "basic defines":

Create the main project structure. One or more different deployment projects can exist on a node.

    puppi::project

Create a single command to be placed in the init sequence. It's not required for every project.

    puppi::initialize

Create a single command to be placed in the deploy sequence. More than one is generally needed for each project.

    puppi::deploy

Create a single command to be placed in the rollback sequence. More than one is generally needed for each project.

    puppi::rollback

Create a single check (based on Nagios plugins) for a project or for the whole host (host wide checks are auto generated by Example42 monitor module)

    puppi::check

Create a reporting command to be placed in the report sequence.

    puppi::report

Create a log filename entry for a project or the whole hosts.

    puppi::log

Create an info entry with the commands used to provide info on a topic

    puppi::info

Read details in the relevant READMEs

FILE PATHS (all of them are provided, and can be configured, in the puppi module):

A link to the actual version of puppi enabled

    /usr/sbin/puppi

The original puppi bash command.

    /usr/sbin/puppi.one

Puppi (one) main config file. Various puppi wide paths are defined here.

    /etc/puppi/puppi.conf

Directory where by default all the host wide checks can be placed. If you use the Example42 monitor module and have "puppi" as $monitor_tool, this directory is automatically filled with Nagios plugins based checks.

    /etc/puppi/checks/ ($checksdir)

Directory that contains projects subdirs, with the commands to be run for deploy, rollback and check actions. They are completely built (and purged) by the Puppet module.

    /etc/puppi/projects/ ($projectsdir)

The general-use scripts directory, these are used by the above commands and may require one or more arguments.

    /etc/puppi/scripts/ ($scriptsdir)

The general-use directory where files are placed which contain the log paths to be used by puppi log

    /etc/puppi/logs/ ($logssdir)

The general-use directory where files are placed which contain the log paths to be used by puppi log

    /etc/puppi/info/ ($infodir)

Where all data to rollback is placed.

    /var/lib/puppi/archive/ ($archivedir)

Where logs and reports of the different commands are placed.

    /var/log/puppi/ ($logdir)

Temporary, scratchable, directory where Puppi places temporary files.

    /tmp/puppi/ ($workdir)

A runtime configuration file, which is used by all the the scripts invoked by puppi to read and write dynamic variables at runtime. This is necessary to maintain "state" information that changes on every puppi run (such as the deploy datetime, used for backups).

    /tmp/puppi/$project/config

HOW TO CUSTOMIZE

It should be clear that with puppi you have full flexibility in the definition of a deployment procedure, since the puppi command is basically a wrapper that executes arbitrary scripts with a given sequence, in pure KISS logic.

The advantanges though, are various:

  • You have a common syntax to manage deploys and rollbacks on an host

  • In your Puppet manifests, you can set in simple, coherent and still flexible and customizable defines all the elements, you need for your application deployments. Think about it: with just a Puppet define you build the whole deploy logic

  • Reporting for each deploy/rollback is built-in and extensible

  • Automatic checks can be built in the deploy procedure

  • You have a common, growing, set of general-use scripts for typical actions

  • You have quick and useful command to see what's happening on the system (puppi check, log, info)

There are different parts where you can customize the behaviour of puppi:

  • The set of general-use scripts in /etc/puppi/scripts/ ( this directory is filled with the content of puppi/files/scripts/ ) can/should be enhanced. These can be arbitrary scripts in whatever language. If you want to follow puppi's logic, though, consider that they should import the common and runtime configuration files and have an exit code logic similar to the one of Nagios plugins: 0 is OK, 1 is WARNING, 2 is CRITICAL. Note that by default a script that exits with WARNING doesn't block the deploy procedure, on the other hand, if a script exits with CRITICAL (exit 2) by default it blocks the procedure. Take a second, also, to explore the runtime config file created by the puppi command that contains variables that can be set and used by the scripts invoked by puppi.

  • The custom project defines that describe deploy templates. These are placed in puppi/manifests/project/ and can request all the arguments you want to feed your scripts with. Generally is a good idea to design a standard enough template that can be used for all the cases where the deployment procedure involves similar steps. Consider also that you can handle exceptions with variables (see the $loadbalancer_ip usage in puppi/manifests/project/maven.pp)

(NO) DEPENDENCIES AND CONFLICTS

Puppi is self contained. It doesn't require other modules. (And is required by all Example42 modules).

For correct functionality by default some extra packages are installed. If you have conflicts with your existing modules, set the argument:

install_dependencies => false

More Repositories

1

psick

Puppet Systems Infrastructure Construction Kit: The control-repo
Shell
659
star
2

puppet-modules-nextgen

Example42 Puppet Modules Version 2.x
Ruby
84
star
3

puppet-playground

A Vagrant MultiOS environment to test Puppet code and modules
Puppet
73
star
4

puppet-tp

Tiny Puppet - The Universal Installer
Puppet
67
star
5

puppet-yum

Puppet module for Yum
Puppet
43
star
6

puppet-apache

Apache Puppet Module
Puppet
42
star
7

puppet-network

Puppet module to manage networking on Suse, Debian and RedHat.
Puppet
31
star
8

puppet-infrastructures

Example(42) Puppet infrastructures
26
star
9

Example42-tutorials

Puppet Tutorials and Documentation
Shell
23
star
10

puppet-psick

An opinionated, integrated, extendable Puppet infrastructure module.
HTML
23
star
11

hdm

Hiera Data Manager
Ruby
17
star
12

puppet-solr

Module to install and configure Apache - Solr
Puppet
17
star
13

puppet-architectures

Sample Puppet Architectures Playground
Shell
16
star
14

puppet-mysql

Mysql Puppet Module
Puppet
16
star
15

puppet-jboss

Jboss Puppet Module
Puppet
15
star
16

puppetguide-book

The [DevOps] Guide to Puppet, Universe, and Everything - BOOK
15
star
17

puppet-jenkins

Puppet module for Jenkins
Puppet
15
star
18

puppetguide-slides

The [DevOps] Guide to Puppet, Universe, and Everything - SLIDES
CSS
15
star
19

puppet-iptables

Iptables Puppet Module (for host based firewalling)
Puppet
14
star
20

puppet-splunk

Splunk Puppet Module
Puppet
12
star
21

puppet-tomcat

Tomcat Puppet Module
Puppet
11
star
22

puppet-puppet

Puppet module to manage Puppet
Puppet
10
star
23

Example42-tools

Some scripts and tools to manage Example42 Puppet Modules
Shell
10
star
24

puppet-monitor

Example42 Monitor abstraction meta-module
Puppet
9
star
25

puppet-kibana

Puppet module for Kibana 3 based on stdmod naming standards
Puppet
9
star
26

puppet-redis

Redis Puppet Module
Puppet
9
star
27

puppet-openssh

Openssh Puppet Module
Puppet
9
star
28

puppet-haproxy

HaProxy Puppet Module
Puppet
8
star
29

puppet-mongodb

Puppet module for MongoDB
Puppet
8
star
30

puppet-wordpress

Module to install and configure WordPress
Puppet
8
star
31

puppet-postgresql

Puppet PostgreSQL module
Puppet
8
star
32

tinydata

Tiny Data for Tiny Puppet & C.
Ruby
7
star
33

puppet-nrpe

Nrpe Puppet Module
Puppet
7
star
34

puppet-orientdb

OrientDB Puppet Module
Puppet
7
star
35

puppet-zabbix_agent

Puppet module for Zabbix Agent
Ruby
7
star
36

Example42-templates

A collection of different sample Puppet modules layouts.
Shell
7
star
37

puppetguide-reference

The Puppet Ultimate Reference: info and links that matter
6
star
38

puppet-vagrant

Puppet module for Vagrant
Puppet
6
star
39

puppet-mcollective

Puppet module to manage the Mcollective ecosystem
Ruby
5
star
40

puppet-puppetdashboard

A Puppet module for the Puppet DashBoard
Puppet
5
star
41

puppet-example42

A sample "site" module for the NextGen modules
Puppet
5
star
42

puppet-hosts

Puppet module to manage /etc/hosts statically or dynamically
Puppet
5
star
43

puppet-logrotate

Puppet module for Logrotate
Puppet
4
star
44

puppet-apt

Puppet module to manage apt
Ruby
4
star
45

puppet-resolver

Puppet module to manage /etc/resolv.conf
Puppet
4
star
46

puppet-postfix

Puppet module for Postfix
Puppet
4
star
47

puppet-logstash

Puppet module for Logstash
Puppet
4
star
48

puppet-ntp

Puppet module for NTP
Puppet
4
star
49

puppet-mariadb

Puppet MariaDB module
Puppet
4
star
50

puppet-sudo

Puppet module to manage sudo
Puppet
4
star
51

puppet-docker

Puppet 4 module for Docker
Puppet
4
star
52

puppet-django

Puppet module for Django
Puppet
4
star
53

puppet-vsftpd

Puppet module for Vsftpd
Puppet
4
star
54

puppet-nagios

Puppet module for Nagios
Puppet
4
star
55

puppet-sysctl

Puppet module for Sysctl
Puppet
3
star
56

puppet-graylog2

Puppet module for Graylog2
Puppet
3
star
57

tp-playground

Tiny Puppet Playground - Test and Play with Tiny Puppet
Puppet
3
star
58

Example42-documentation

Documentation for Example42 Modules
Puppet
3
star
59

puppet-pentaho

Puppet module for Pentaho Data Integration ( Kettle )
Puppet
3
star
60

control-repo-archive

The original example42 control-repo with full commit history since 2009
HTML
3
star
61

puppet-perl

Puppet module to manage Perl and CPAN modules
Puppet
3
star
62

puppet-icinga

Puppet modules for Icinga
Puppet
3
star
63

psick-hieradata

Sample Hiera data, as module, for the PSICK control-repo
Shell
3
star
64

puppet-firewall

Example42 Firewall abstraction meta-module
Puppet
3
star
65

puppet-monit

Puppet module for Monit
Puppet
3
star
66

example42.github.io

Example 42 Website
JavaScript
3
star
67

puppet-munin

Puppet module for Munin
Puppet
3
star
68

puppet-exim

Puppet module for Exim
Puppet
2
star
69

puppet-timezone

Puppet module for Timezone management
Puppet
2
star
70

puppet-puppetdb

PuppetDB module
Puppet
2
star
71

puppet-libvirt

Puppet module for libvirt
Puppet
2
star
72

puppet-unicorn

Puppet module for Unicorn
Puppet
2
star
73

puppet-heat

Minimal Puppet module for OpenStack Heat
Puppet
2
star
74

puppet-git

Puppet module to install and manage git
Puppet
2
star
75

puppet-psick_profile

Opinionated profiles to manage common applications
Puppet
2
star
76

puppet-workshop

Puppet Code fragments for workshops
Puppet
2
star
77

puppet-tinc

Puppet module for Tinc
Puppet
2
star
78

puppet-activemq

Puppet module for ActiveMQ
Puppet
2
star
79

puppet-rsyslog

Puppet module for Rsyslog
Puppet
2
star
80

puppet-svn

Puppet module to manage Subversion
Puppet
2
star
81

puppet-java

Puppet module for Java
Puppet
2
star
82

puppet-limits

Puppet module to manage limits
Puppet
1
star
83

answers

A collection of things, also answers
JavaScript
1
star
84

puppet-lighttpd

Puppet module for Lighttpd
Puppet
1
star
85

tp_desktop

Your smart way to Cross OS Desktop configuration as Code
Shell
1
star
86

puppet-xinetd

Xinetd Puppt module
Puppet
1
star
87

puppet-vim

Puppet module for Vim
Puppet
1
star
88

puppet-profile

Puppet module to manage /etc/profile and /etc/profile.d
Puppet
1
star
89

puppet-nfs

Puppet module for NFS
Puppet
1
star
90

puppetguide-cheatsheets

A collection of Puppet cheatsheets
CSS
1
star
91

PuppetWorkshop

A Puppet Workshop based on a Vagrant environment
Shell
1
star
92

puppet-heartbeat

Puppet module for Heartbeat
Puppet
1
star
93

puppet-pam

Puppet module to manage pam
Puppet
1
star
94

puppet-rsync

Puppet module for Rsync
Puppet
1
star
95

pdk-module-template-tp-profile-minimal-tests

PDK template for profiles in tp_profile module with minimal spec tests
HTML
1
star
96

puppet-sendmail

Puppet module for Sendmail
Puppet
1
star
97

puppet-openntpd

Openntpd Puppet Module
Puppet
1
star
98

puppet-elasticsearch

Puppet module for ElasticSearch
Shell
1
star
99

puppet-tftp

Tftp Puppet module
Puppet
1
star
100

puppet-openvpn

OpenVpn Puppet module
Puppet
1
star