commit 24f1e677c4b35d17f54450da004c33853671eb81 Author: Kienan Stewart Date: Wed Nov 30 16:31:23 2016 -0500 Initial commit of aegir puppet module diff --git a/README.md b/README.md new file mode 100644 index 0000000..70b0ef6 --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +# aegir + +## Module Description + +This module is intended to install aegir simply. + +## Requirements + +Modules from forge.puppet.com: + +* puppetlabs-stdlib (tested with 4.13.1) +* puppetlabs-apt (tested with 2.3.0) + +Currently only supports installation through debian packages. + +## Setup + +Nothing special. + +## Usage + +@TODO + +## Reference + +### Classes + +#### Public Classes + +* aegir::hostmaster + +### Class: aegir::hostmaster + +Debian package based hostmaster installation. + +Parameters: + +* database: A hash containing user, host, and password. Required. +* frontend_url: The url for the hostmaster drupal installation. Optional, defaults to the fully qualified domain name. +* version: The major aegir version to install. Optional, default: 3 +* user: The user name to use for the installation of aegir. Optional, default: aegir +* home: The home directory of the user. Optional, default: /var/aegir +* server: Which webserver to use. Optional, default: apache. Supports: apache2, nginx +* release: Which release to use from the package source. Optional, default: stable. +* makefile: If a custom makefile should be used, specify it here. Optional, default: '' +* email: The email to set for the admin user in the hostmaster installation. Optional, default: '' (aegir will pick the user@fqdn). +* working_copy: Keep the hostmaster platform git directories? Optional, default: false. +* drush_version: Which version of drush to install with provision. Optional, default '' (stable). diff --git a/_metadata.json b/_metadata.json new file mode 100644 index 0000000..a8d0158 --- /dev/null +++ b/_metadata.json @@ -0,0 +1,17 @@ +{ + "name": "aegir", + "version": "0.0.1", + "author": "Kienan Stewart", + "license": "GPL-3.0+", + "summary": "A module for installing aegir", + "operatingsystem_support": [ + { + "operatingsystem": "Debian", + "operatingsystemrelease": [ "wheezy", "jessie"] + } + ], + "dependencies": [ + { "name": "puppetlabs/apt", "version_requirement": ">= 2.3.0"}, + { "name": "puppetlabs/stdlib", "version_requirement": ">= 4.13.1"} + ] +} diff --git a/manifests/hostmaster.pp b/manifests/hostmaster.pp new file mode 100644 index 0000000..cf11a6a --- /dev/null +++ b/manifests/hostmaster.pp @@ -0,0 +1,65 @@ +# Installs a hostmaster on a debian system using the available repos. +# This module should be called from a profile where the other major software +# eg, webserver and db server are decided on. +class aegir::hostmaster ( + # A hash with 'user', 'host', 'password'. Currently only mysql is supported by + # aegir. + $database, + $frontend_url = $::fqdn, + $version = 3, + $user = 'aegir', # Unused + $home = '/var/aegir', # Unused + # The webserver, apache2 or nginx. + $server = 'apache2', + # Commonly available releases: stable, unstable. + $release = 'stable', + $makefile = '', + $email = '', + $working_copy = false, + $drush_version = '' +) { + include apt + #include stdlib + apt::source { 'aegir': + location => 'http://debian.aegirproject.org', + release => $release, + key => { + id => '12782E2257B468806EF36D165ADF93A03376CCF9', + source => 'http://debian.aegirproject.org/key.asc', + }, + repos => 'main' + } + $package_name = "aegir${version}" + $debconf_settings = [ + "${package_name}-hostmaster aegir/site string ${frontend_url}", + "${package_name}-hostmaster aegir/db_password string ${database['password']}", + "${package_name}-hostmaster aegir/db_host string ${database['host']}", + "${package_name}-hostmaster aegir/db_user string ${database['user']}" + ] + if $email { + $debconf_settings += "${package_name}-hostmaster aegir/email string ${email}" + } + if $makefile { + $debconf_settings += "${package_name}-hostmaster aegir/makefile string ${makefile}" + } + if $working_copy { + $debconf_settings += "${package_name}-hostmaster aegir/working-copy boolean true" + } + if $drush_version { + $debconf_settings += "aegir${version}-provision aegir/drush_version string ${drush_version}" + } + file { '/etc/dpkg/aegir.response': + ensure => 'file', + content => join($debconf_settings, "\n") + } + package { 'aegir': + ensure => 'installed', + name => $package_name, + responsefile => '/etc/dpkg/aegir.response', + require => [ + Apt::Source['aegir'], + Class['apt::update'], + File['/etc/dpkg/aegir.response'] + ] + } +}