Added puppet module skeleton (also puppet module tool is lame)
This commit is contained in:
32
puppet/Makefile
Normal file
32
puppet/Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
MAJOR:=$(shell bash -c 'source version.sh ; echo $$MAJOR')
|
||||
BUILD:=$(shell bash -c 'source version.sh ; echo $$BUILD')
|
||||
MODULEPATH:=$(shell puppet config print modulepath)
|
||||
ifeq ($(MODULEPATH),)
|
||||
$(error "I can't figure out your puppet modulepath, this will cause all kinds of bad things to happen with 'make install' and 'make uninstall'")
|
||||
endif
|
||||
PUPPET_DEPS=$(find mercy -type f)
|
||||
PUPPET_DIST=mercy/pkg/akesterson-mercy-$(MAJOR).$(BUILD).tar.gz
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm pkg/*
|
||||
rm Modulefile
|
||||
|
||||
mercy/Modulefile: Modulefile.template.sh version.sh
|
||||
source version.sh && bash Modulefile.template.sh > Modulefile
|
||||
|
||||
$(PUPPET_DIST): $(PUPPET_DEPS) mercy/Modulefile
|
||||
rm -f $(PUPPET_DIST)
|
||||
mkdir -p $$(dirname $(PUPPET_DIST))
|
||||
echo 'We would use puppet module tool here but we dont because it doesnt work on windows buildhosts and cant upload from the command line anyway'
|
||||
tar --exclude=mercy/Modulefile --exclude=mercy/pkg -czvf $(PUPPET_DIST) mercy/
|
||||
|
||||
dist: $(PUPPET_DIST)
|
||||
|
||||
all: $(PUPPET_DIST)
|
||||
|
||||
install: $(PUPPET_DIST)
|
||||
tar -zxvf $(PUPPET_DIST) -C $(MODULEPATH)
|
||||
|
||||
uninstall:
|
||||
rm -fr $(MODULEPATH)/mercy
|
||||
12
puppet/Modulefile.template.sh
Normal file
12
puppet/Modulefile.template.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
cat <<EOF
|
||||
name 'akesterson-mercy'
|
||||
version '${MAJOR}-${BUILD}'
|
||||
dependency 'apache/apache'
|
||||
summary 'Puppet module for deploying the mercy web application'
|
||||
description 'Puppet module for deploying the mercy web application'
|
||||
project_page http://github.com/akesterson/mercy/tree/master/puppet
|
||||
license 'MIT'
|
||||
author 'Andrew Kesterson <andrew@aklabs.net>'
|
||||
EOF
|
||||
36
puppet/README.md
Normal file
36
puppet/README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
mercy
|
||||
=====
|
||||
|
||||
A puppet module for installing the Mercy Flask application
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
This puppet module assumes that you have:
|
||||
|
||||
* Working apache with a puppet service
|
||||
* Working python 2.7 and pip
|
||||
* Working postgres with a username, password, and database for mercy to use
|
||||
|
||||
Aside from that, the module has no dependencies.
|
||||
|
||||
Usage
|
||||
=========
|
||||
|
||||
class { 'mercy::application':
|
||||
environment => 'dev|production',
|
||||
ensure => 'absent|latest|MAJOR-MINOR',
|
||||
vhost_dir => '/etc/apache/httpd/conf.d',
|
||||
apache_service => 'httpd',
|
||||
postgres_uri => 'localhost',
|
||||
postgres_user => 'mercy',
|
||||
postgres_pw => 'mercy',
|
||||
postgres_db => 'mercy'
|
||||
}
|
||||
|
||||
If 'environment' is dev, then the mercy application will be installed via a tarball located in ./mercy/files/mercy-${ensure}.tar.gz. If 'environment' is production, then mercy will be installed via pip and ensured at the given version.
|
||||
|
||||
Events
|
||||
======
|
||||
|
||||
This puppet module will notify your apache service whenever the vhost is modified, or the mercy application version is updated, since an apache graceful restart will be required in either case.
|
||||
Reference in New Issue
Block a user