summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authorSergey Stankevich <sergey.stankevich@gmail.com>2012-09-09 18:36:30 -0400
committerSergey Stankevich <sergey.stankevich@gmail.com>2012-09-09 18:36:30 -0400
commited137893babebabdfdb5adf44d1a52272093ce8b (patch)
treef611108dc849fe8f4372aac981d7e242d59b957b /manifests/init.pp
Initial import
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp50
1 files changed, 50 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
new file mode 100644
index 0000000..c7ab10f
--- /dev/null
+++ b/manifests/init.pp
@@ -0,0 +1,50 @@
+# == Class: python
+#
+# Installs and manages python, python-dev, python-virtualenv and Gunicorn.
+#
+# === Parameters
+#
+# [*version*]
+# Python version to install. Default: system default
+#
+# [*dev*]
+# Install python-dev. Default: false
+#
+# [*virtualenv*]
+# Install python-virtualenv. Default: false
+#
+# [*gunicorn*]
+# Install Gunicorn. Default: false
+#
+# === Examples
+#
+# class { 'python':
+# version => 'system',
+# dev => true,
+# virtualenv => true,
+# gunicorn => true,
+# }
+#
+# === Authors
+#
+# Sergey Stankevich
+#
+class python (
+ $version = 'system',
+ $dev = false,
+ $virtualenv = false,
+ $gunicorn = false
+) {
+
+ # Module compatibility check
+ $compatible = [ 'Debian', 'Ubuntu' ]
+ if ! ($::operatingsystem in $compatible) {
+ fail("Module is not compatible with ${::operatingsystem}")
+ }
+
+ Class['python::install'] -> Class['python::config']
+
+ include python::install
+ include python::config
+
+}