Cleanup pass

This commit is contained in:
Kienan Stewart 2018-06-15 16:19:14 -04:00
parent f206817a27
commit c30e659ac3
5 changed files with 139 additions and 58 deletions

View File

@ -25,8 +25,8 @@ This module is intended to install aegir simply.
Modules from forge.puppet.com: Modules from forge.puppet.com:
* puppetlabs-stdlib (tested with 4.15.0) * puppetlabs-stdlib (tested with 4.25.1)
* puppetlabs-apt (tested with 2.3.0) * puppetlabs-apt (tested with 2.4.0)
Operating systems: Debian derivatives. Operating systems: Debian derivatives.
@ -45,16 +45,38 @@ Nothing special.
### Install a hostmaster ### Install a hostmaster
```puppet ```puppet
# Using puppetlabs/mysql (5.4.0) as example
class { '::mysql::server':
package_name => 'default-mysql-server',
service_name => 'mysqld',
users => {
'aegirroot@localhost' => {
'password_hash' => mysql_password('examplepassword'),
},
},
grants => {
'aegirroot@localhost/*.*' => {
'user' => 'aegirroot@localhost',
'table' => '*.*',
'privileges' => ['ALL'],
'options' => ['GRANT'],
},
},
}
# Assumes mysql or mariadb is installed # Assumes mysql or mariadb is installed
# and that there is a user aegir_root # and that there is a user aegir_root
# with all grants etc permissions on *.* # with all grants etc permissions on *.*
class { '::aegir::hostmaster': { class { 'aegir::hostmaster':
database => { database => {
host => 'localhost', host => 'localhost',
user => 'aegir_root', user => 'aegirroot',
password => 'examplepassword' password => 'examplepassword'
} }
} }
Class['::mysql::server']
->Class['::aegir::hostmaster']
``` ```
## Reference ## Reference
@ -64,6 +86,7 @@ class { '::aegir::hostmaster': {
#### Public Classes #### Public Classes
* aegir::hostmaster * aegir::hostmaster
* aegir::source
### Class: aegir::hostmaster ### Class: aegir::hostmaster
@ -75,8 +98,17 @@ Parameters:
* frontend_url: The url for the hostmaster drupal installation. Optional, defaults to the fully qualified domain name. * 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 * version: The major aegir version to install. Optional, default: 3
* server: Which webserver to use. Optional, default: apache. Supports: apache2, nginx * server: Which webserver to use. Optional, default: apache. Supports: apache2, nginx
* manage_sources: Add source for Aegir packages. Default: true
* release: Which release to use from the package source. Optional, default: stable. * 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: '' * 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). * 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. * working_copy: Keep the hostmaster platform git directories? Optional, default: false.
* drush_version: Which version of drush to install with provision. Optional, default '' (stable). * drush_version: Which version of drush to install with provision. Optional, default '' (stable).
### Class: aegir::source
Adds the debian apt source
Parameters:
* release: Which release of aegir to use. Default: stable

64
files/key.asc Normal file
View File

@ -0,0 +1,64 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBE6UpTYBEACl8WyZrrcbMe4wfFQW2HMJP9PrDolioDlZZDpC9VesU2E1WFTW
jOZQY33HG/89evHLWg78JVo57z+OgmFS4bv7aGoynId5KfSF/azI9ibRCWMXHBa+
Mp8Pk+ufb3InYe7thOJQ9q1DGf/jg42+a31rpsiW58+HGACn3fIhdU8MhVcZ45NS
gVJI0yeOnacpvtMCmQwTZdhmG4d9hV7RcaN46fWz1Ys0qPJ3PGaRK7R4Qb6/+hPg
p9tvfjyUw0e6dWmAgHkoo54mpiYdPgD6+S7nuqbeFGzai1GVcwCH9Ec6/E9L4wnD
c0rvstyyBlaGyPSakViw46ZbE2VQK/uPEciqBmJUm8Yzh3uOhk5ufS11hC4S3F/t
VeJWZwIEBQGX0a81eMDtu0XtK+5B+WFsQ1ZLeUaK0hhZwoJS5wsbyhNi1KYLOucV
OaeAcz8snzw4q0MtJKxPT4TVhE78uu6DsoW7yY3atOIfGTuS4dUV3ahGxSC0r+Pw
BRqQ09vhu2z96zuLFHrlMmcG/OloHwIOOgk2sQ1YaP7Gklr8mk+c8hqX/TWci7N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
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -4,70 +4,44 @@
class aegir::hostmaster ( class aegir::hostmaster (
# A hash with 'user', 'host', 'password'. Currently only mysql is supported by # A hash with 'user', 'host', 'password'. Currently only mysql is supported by
# aegir. # aegir.
$database, Hash $database,
$frontend_url = $::fqdn, String $frontend_url = $facts['fqdn'],
$version = 3, # This is the major version only.
$user = 'aegir', # Unused Integer $version = 3,
$home = '/var/aegir', # Unused
# The webserver, apache2 or nginx. # The webserver, apache2 or nginx.
$server = 'apache2', $server = 'apache2',
$manage_sources = true,
# Commonly available releases: stable, unstable. # Commonly available releases: stable, unstable.
$release = 'stable', String $release = 'stable',
$makefile = '', $makefile = '',
$email = '', $email = '',
$working_copy = false, $working_copy = false,
$drush_version = '' $drush_version = 'stable'
) { ) {
include apt if $manage_sources {
include stdlib class { 'aegir::source':
apt::source { 'aegir':
location => 'http://debian.aegirproject.org',
release => $release, release => $release,
key => { }
id => '12782E2257B468806EF36D165ADF93A03376CCF9', Class['aegir::source']
source => 'http://debian.aegirproject.org/key.asc', -> Class['apt::update']
}, -> Package['aegir']
repos => 'main'
} }
$package_name = "aegir${version}" $package_name = "aegir${version}"
$working_copy_str = String($working_copy, '%s')
$debconf_settings = [ $debconf_settings = [
"${package_name}-hostmaster aegir/site string ${frontend_url}", "${package_name}-hostmaster aegir/site string ${frontend_url}",
"${package_name}-hostmaster aegir/db_password string ${database['password']}", "${package_name}-hostmaster aegir/db_password password ${database['password']}",
"${package_name}-hostmaster aegir/db_host string ${database['host']}", "${package_name}-hostmaster aegir/db_host string ${database['host']}",
"${package_name}-hostmaster aegir/db_user string ${database['user']}", "${package_name}-hostmaster aegir/db_user string ${database['user']}",
"${package_name}-hostmaster aegir/webserver select ${server}", "${package_name}-hostmaster aegir/webserver select ${server}",
"${package_name}-hostmaster aegir/email string ${email}",
"${package_name}-hostmaster aegir/makefile string ${makefile}",
"${package_name}-hostmaster aegir/working-copy boolean ${working_copy_str}",
"${package_name}-provision aegir/drush_version string ${drush_version}",
] ]
if $email != '' { file { '/var/lib/dpkg/aegir.response':
$debconf_email = ["${package_name}-hostmaster aegir/email string ${email}"]
}
else {
$debconf_email = []
}
if $makefile != '' {
$debconf_makefile = ["${package_name}-hostmaster aegir/makefile string ${makefile}"]
}
else {
$debconf_makefile = []
}
if $working_copy {
$debconf_working_copy = ["${package_name}-hostmaster aegir/working-copy boolean true"]
}
else {
$debconf_working_copy = []
}
if $drush_version != '' {
$debconf_drush = ["${package_name}-provision aegir/drush_version string ${drush_version}"]
}
else {
$debconf_drush = []
}
file { '/etc/dpkg/aegir.response':
ensure => 'file', ensure => 'file',
content => join( content => join($debconf_settings, "\n"),
concat(
$debconf_settings, $debconf_email, $debconf_makefile,
$debconf_working_copy, $debconf_drush),
"\n")
} }
if ($server == 'nginx') { if ($server == 'nginx') {
# Install nginx and phpX-fpm before running the aegir install. # Install nginx and phpX-fpm before running the aegir install.
@ -86,14 +60,12 @@ class aegir::hostmaster (
# Pass in extra packages through install options for nginx support. # Pass in extra packages through install options for nginx support.
# Even with aegir/webserver set in preconfig, apt-get tries to install # Even with aegir/webserver set in preconfig, apt-get tries to install
# with phpX (not fpm). # with phpX (not fpm).
# Note: this may fail for some versions of Aegir:
# @see https://www.drupal.org/project/provision/issues/2979947
package { 'aegir': package { 'aegir':
ensure => 'installed', ensure => 'installed',
name => $package_name, name => $package_name,
responsefile => '/etc/dpkg/aegir.response', responsefile => '/etc/dpkg/aegir.response',
require => [ require => File['/var/lib/dpkg/aegir.response'],
Apt::Source['aegir'],
Class['apt::update'],
File['/etc/dpkg/aegir.response']
]
} }
} }

13
manifests/source.pp Normal file
View File

@ -0,0 +1,13 @@
class aegir::source (
String $release = 'stable'
) {
apt::source { 'aegir':
location => 'http://debian.aegirproject.org',
release => $release,
key => {
id => '12782E2257B468806EF36D165ADF93A03376CCF9',
content => file('aegir/key.asc'),
},
repos => 'main'
}
}

View File

@ -15,7 +15,7 @@
} }
], ],
"dependencies": [ "dependencies": [
{ "name": "puppetlabs/apt", "version_requirement": ">= 2.3.0 < 3.0.0"}, { "name": "puppetlabs/apt", "version_requirement": ">= 2.4.0 < 5.0.0"},
{ "name": "puppetlabs/stdlib", "version_requirement": ">= 4.13.1 < 5.0.0"} { "name": "puppetlabs/stdlib", "version_requirement": ">= 4.13.1 < 5.0.0"}
], ],
"requirements": [ "requirements": [