Version information
This version is compatible with:
- Puppet Enterprise 3.x
- Puppet 3.x
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'sbitio-webapp', '0.2.0'
Learn more about managing modules with a PuppetfileDocumentation
Puppet Webapp
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
Change Log
0.2.0 (2017-03-26)
- Add support for Options directive
- Sanitize database name
- Fine grained autorealization
- Allow passing arbitrary params to ::apache::vhost directly
- Enable providing undef values from Hiera as ''
0.1.0 (2015-07-09)
Initial release.
* This Change Log was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 1.0.0)
The MIT License (MIT) Copyright (c) 2014 SB IT Media, S.L. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.