Initial commit

This commit is contained in:
2014-11-23 19:45:01 +00:00
commit 3b1b23732e
19 changed files with 625 additions and 0 deletions

82
manifests/config.pp Normal file
View File

@@ -0,0 +1,82 @@
# == Class: dokuwiki::config
#
# See the README.md for documentation
#
class dokuwiki::config (
$manage_vhost = $dokuwiki::manage_vhost,
$vhost = $dokuwiki::vhost,
$base_path = $dokuwiki::base_path,
$apache_confdir = $dokuwiki::apache_confdir,
$apache_user = $dokuwiki::apache_user,
$apache_group = $dokuwiki::apache_group,
$install_dir = $dokuwiki::install_dir,
$data_dir = $dokuwiki::data_dir,
$local_conf_template = $dokuwiki::local_conf_template,
$protected_conf_template = $dokuwiki::protected_conf_template,
$wiki_title = $dokuwiki::wiki_title,
$userewrite = $dokuwiki::userewrite,
$use_acl = $dokuwiki::use_acl,
$breadcrumbs = $dokuwiki::breadcrumbs,
$youarehere = $dokuwiki::youarehere,
$updatecheck = $dokuwiki::updatecheck,
$content_license = $dokuwiki::content_license,
$locktime = $dokuwiki::locktime,
$auth_type = $dokuwiki::auth_type,
$ldap_version = $dokuwiki::ldap_version,
$ldap_servers = $dokuwiki::ldap_servers,
$ldap_user_tree = $dokuwiki::ldap_user_tree,
$ldap_user_filter = $dokuwiki::ldap_user_filter,
$ldap_user_scope = $dokuwiki::ldap_user_scope,
$ldap_user_account_attr = $dokuwiki::ldap_user_account_attr,
$ldap_group_tree = $dokuwiki::ldap_group_tree,
$ldap_group_filter = $dokuwiki::ldap_group_filter,
$ldap_group_scope = $dokuwiki::ldap_group_scope,
$ldap_starttls = $dokuwiki::ldap_starttls,
$ldap_use_sso = $dokuwiki::ldap_use_sso,
$ldap_recursive_search = $dokuwiki::ldap_recursive_search,
$ldap_binddn = $dokuwiki::ldap_binddn,
$ldap_bindpw = $dokuwiki::ldap_bindpw,
$use_referrals = $dokuwiki::use_referrals,
$ldap_mapping_name = $dokuwiki::ldap_mapping_name,
$ldap_mapping_groups = $dokuwiki::ldap_mapping_groups,
) {
if $base_path == '' or $base_path =~ /\/$/ {
$base_path_suffix = ''
} else {
$base_path_suffix = '/'
}
file {
"${install_dir}/${base_path}${base_path_suffix}conf/local.php":
content => template($local_conf_template),
owner => 'root',
group => 'root',
mode => '0444',
replace => false;
"${install_dir}/${base_path}${base_path_suffix}conf/local.protected.php":
content => template($protected_conf_template),
owner => 'root',
group => 'root',
mode => '0444';
$data_dir:
ensure => directory,
owner => $apache_user,
group => $apache_group,
mode => '0664';
}
if $manage_vhost {
file {
"${apache_confdir}/${vhost}.conf":
content => template('dokuwiki/vhost.conf.erb'),
owner => 'root',
group => 'root',
mode => '0444';
}
}
}

80
manifests/init.pp Normal file
View File

@@ -0,0 +1,80 @@
# == Class: dokuwiki
#
# See the README.md for documentation
#
class dokuwiki (
$version = $dokuwiki::params::version,
$package_category = $dokuwiki::params::package_category,
$package_name = $dokuwiki::params::package_name,
$use_webapp_config = $dokuwiki::params::use_webapp_config,
$manage_vhost = $dokuwiki::params::manage_vhost,
$vhost = $dokuwiki::params::vhost,
$base_path = $dokuwiki::params::base_path,
$apache_confdir = $dokuwiki::params::apache_confdir,
$apache_user = $dokuwiki::params::apache_user,
$apache_group = $dokuwiki::params::apache_group,
$vhost_conf_template = $dokuwiki::params::vhost_conf_template,
$install_dir = $dokuwiki::params::install_dir,
$data_dir = $dokuwiki::params::data_dir,
$local_conf_template = $dokuwiki::params::local_conf_template,
$protected_conf_template = $dokuwiki::params::protected_conf_template,
$wiki_title = $dokuwiki::params::wiki_title,
$userewrite = $dokuwiki::params::userewrite,
$use_acl = $dokuwiki::params::use_acl,
$breadcrumbs = $dokuwiki::params::breadcrumbs,
$youarehere = $dokuwiki::params::youarehere,
$updatecheck = $dokuwiki::params::updatecheck,
$content_license = $dokuwiki::params::content_license,
$locktime = $dokuwiki::params::locktime,
$auth_type = $dokuwiki::params::auth_type,
$ldap_version = $dokuwiki::params::ldap_version,
$ldap_servers = $dokuwiki::params::ldap_servers,
$ldap_user_tree = $dokuwiki::params::ldap_user_tree,
$ldap_user_filter = $dokuwiki::params::ldap_user_filter,
$ldap_user_scope = $dokuwiki::params::ldap_user_scope,
$ldap_user_account_attr = $dokuwiki::params::ldap_user_account_attr,
$ldap_group_tree = $dokuwiki::params::ldap_group_tree,
$ldap_group_filter = $dokuwiki::params::ldap_group_filter,
$ldap_group_scope = $dokuwiki::params::ldap_group_scope,
$ldap_starttls = $dokuwiki::params::ldap_starttls,
$ldap_use_sso = $dokuwiki::params::ldap_use_sso,
$ldap_recursive_search = $dokuwiki::params::ldap_recursive_search,
$ldap_binddn = $dokuwiki::params::ldap_binddn,
$ldap_bindpw = $dokuwiki::params::ldap_bindpw,
$use_referrals = $dokuwiki::params::use_referrals,
$ldap_mapping_name = $dokuwiki::params::ldap_mapping_name,
$ldap_mapping_groups = $dokuwiki::params::ldap_mapping_groups,
) inherits dokuwiki::params {
# Allow a big-endian date format with optional letter suffix
validate_re($version, '^\d{8}[a-z]?$')
validate_string($package_category)
validate_string($package_name)
validate_bool($use_webapp_config)
validate_bool($manage_vhost)
validate_string($vhost)
validate_string($base_path)
validate_string($apache_confdir)
validate_string($vhost_conf_template)
validate_absolute_path($install_dir)
validate_absolute_path($data_dir)
validate_string($local_conf_template)
validate_string($protected_conf_template)
include '::dokuwiki::install'
include '::dokuwiki::config'
# Anchor this as per #8040 - this ensures that classes won't float off and
# mess everything up. You can read about this at:
# http://docs.puppetlabs.com/puppet/2.7/reference/lang_containment.html#known-issues
anchor {
'dokuwiki::begin': ;
'dokuwiki::end': ;
}
Anchor['dokuwiki::begin']
-> Class['::dokuwiki::install']
-> Class['::dokuwiki::config']
-> Anchor['dokuwiki::end']
}

34
manifests/install.pp Normal file
View File

@@ -0,0 +1,34 @@
# == Class: dokuwiki::install
#
# See the README.md for documentation
#
class dokuwiki::install (
$version = $dokuwiki::version,
$package_category = $dokuwiki::package_category,
$package_name = $dokuwiki::package_name,
$use_webapp_config = $dokuwiki::use_webapp_config,
$vhost = $dokuwiki::vhost,
$base_path = $dokuwiki::base_path,
) {
package {
'www-apps/dokuwiki':
ensure => $version,
category => $package_category,
name => $package_name;
}
if $use_webapp_config {
webapp_config {
"dokuwiki-${version}":
action => 'install',
vhost => $vhost,
base => $base_path,
app => 'dokuwiki',
version => $version,
depends => Package['www-apps/dokuwiki'];
}
}
}

61
manifests/params.pp Normal file
View File

@@ -0,0 +1,61 @@
# == Class: dokuwiki::params
#
# See the README.md for documentation
#
class dokuwiki::params {
case $::osfamily {
'Gentoo': {
$package_category = 'www-apps'
$package_name = 'dokuwiki'
$version = '20140929a'
$use_webapp_config = true
$apache_confdir = '/etc/apache/vhosts.d'
$apache_user = 'apache'
$apache_group = 'apache'
}
default: {
fail("The ${module_name} module is not supported on an ${::osfamily} based system.")
}
}
$manage_vhost = true
$vhost = 'dokuwiki.example.com'
$base_path = 'dokuwiki'
$install_dir = '/var/www/localhost/htdocs'
$data_dir = '/var/www/localhost/htdocs/data'
$vhost_conf_template = 'dokuwiki/vhost.conf.erb'
$local_conf_template = 'dokuwiki/local.php.erb'
$protected_conf_template = 'dokuwiki/local.protected.php.erb'
# Configuration directives
$wiki_title = 'dokuwiki'
$userewrite = true
$use_acl = true
$breadcrumbs = false
$youarehere = true
$updatecheck = false
$content_license = 'CC-BY-SA'
$locktime = 30*60
$auth_type = 'ldap'
$ldap_version = 3
$ldap_servers = ['ldap']
$ldap_user_tree = 'ou=People,dc=local'
$ldap_user_filter = '(&(uid=%{user})(objectClass=posixAccount))'
$ldap_user_scope = 'sub'
$ldap_user_account_attr = 'uid'
$ldap_group_tree = 'ou=Group,dc=local'
$ldap_group_filter = '(&(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUid=%{user})))'
$ldap_group_scope = 'sub'
$ldap_starttls = true
$ldap_use_sso = true
$ldap_recursive_search = true
$ldap_binddn = 'cn=admin,dc=local'
$ldap_bindpw = 'changeme'
$use_referrals = true
$ldap_mapping_name = 'name'
$ldap_mapping_groups = []
}