Forge Home

webapp

Wrapper to create resources that compound webapps

12,636 downloads

6,702 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

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.

Download

Documentation

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.

Dependencies

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.

Limitation

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:

hiera_include('classes')

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
  tags:
    - dbserver
    - webhead1
    - webhead2

webapp::instances :

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

# Create webapp `barbaz.com` without database.
  barbaz.com      :
    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 example.com
# to www.example.com.
# This webapp is declared of type `drupal`, so a drush alias (name `ex`) will
# also be declared.
  ex              :
    type          : drupal
    servername    : example.com
    www_ensure    : present
    serveraliases :
      - example.net
      - www.example.net
    redirects     :
      302         :
        - source  : /under-construction
          dest    : http://www.example.info/landing
    vhost_extra   : |
      ExpiresActive  On
      ExpiresDefault "access plus 10 minutes"
    db_pass       : s3cr3t
    db_grants     :
      'root@localhost/*.*':
        options    : ['GRANT']
        privileges : ['ALL']
        table      : '*.*'
        user       : 'root@localhost'
      'reader@localhost/ex.*'
        options    : ['GRANT']
        privileges : ['SELECT']
        table      : 'ex.*'
        user       : 'reader@localhost'
    cron           :
      cron1 :
        command : '/usr/local/bin/cronjob.sh'
        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.

License

MIT License, see LICENSE file

Contact

Use contact form on http://sbit.io

Support

Please log tickets and issues on GitHub