Forge Home


Wrapper to create resources that compound webapps


6,624 latest version

2.8 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.2.0 (latest)
  • 0.1.0
released Mar 26th 2017
This version is compatible with:
  • Puppet Enterprise 3.x
  • Puppet 3.x
  • , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'sbitio-webapp', '0.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add sbitio-webapp
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install sbitio-webapp --version 0.2.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.



sbitio/webapp — version 0.2.0 Mar 26th 2017

Puppet Webapp

puppet forge version last tag

Wrapper to create resources that compound webapps.

Resources can be declared as local resources or exported ones.

Exported resources are tagged with node's FQDN and realized in those nodes upon the presence of the classes that implements the resources.


This module does not have any hard dependency (but stdlib) so it can work infrastructure-wide.

These are the modules Webapp works with:

How it works

First, include webapp class in each node of your infrastructure that may realize a part of the webapp (apache, mysql, solr).

Second, create webapp instances tagged with the fqdn of each node involved.

Webapp instances must be created only on one node. It doesn't need to be one of the tag nodes. For example, use the one you consider the master.


The realization of exported resources is based on defined(), so class webapp must be included after each related class.

This is how we do it in manifests/00_globals.pp:


include ::webapp
include ::ducktape

Example of use

Class webapp accepts $instances and $instance_defaults parameters. So you can define webapps in hiera as follows:

webapp::instance_defaults :
  port: 80
    - dbserver
    - webhead1
    - webhead2

webapp::instances :

# Create a webapp called ``. This will be the servername and
# database name, user and password.      : {}

# Create webapp `` without database.      :
    db_ensure     : absent

# Create webapp with name `ex`. This is the database name and user. Password
# is provided explicitly. Servername is provided explicitly, along with
# redirects and custom configuration for the virtual host.
# `vhost_ensure : present` will enforce a redirect 301 from
# to
# This webapp is declared of type `drupal`, so a drush alias (name `ex`) will
# also be declared.
  ex              :
    type          : drupal
    servername    :
    www_ensure    : present
    serveraliases :
    redirects     :
      302         :
        - source  : /under-construction
          dest    :
    vhost_extra   : |
      ExpiresActive  On
      ExpiresDefault "access plus 10 minutes"
    db_pass       : s3cr3t
    db_grants     :
        options    : ['GRANT']
        privileges : ['ALL']
        table      : '*.*'
        user       : 'root@localhost'
        options    : ['GRANT']
        privileges : ['SELECT']
        table      : 'ex.*'
        user       : 'reader@localhost'
    cron           :
      cron1 :
        command : '/usr/local/bin/'
        hour    : 23
        minute  : 12

As shown webapp instances allows to define the virtualhost, database or solr instance behaviour to some extent. See webapp/instance.pp for detailed documentation on accepted parameters.


MIT License, see LICENSE file


Use contact form on


Please log tickets and issues on GitHub