Puppet Class: role::externalstore

Defined in:
puppet/modules/role/manifests/externalstore.pp

Overview

Class: role::externalstore

ExternalStore is a system that allows MediaWiki (and optionally extensions) to store content in a separate database, rather than the text table

If you disable this role, you will not be able to access content that was saved when it was active.

Parameters:

  • grant_db_host (Any)
  • db_host (Any)
  • db_name (Any)
  • db_user (Any)
  • db_pass (Any)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'puppet/modules/role/manifests/externalstore.pp', line 8

class role::externalstore (
    $grant_db_host,
    $db_host,
    $db_name,
    $db_user,
    $db_pass,
) {
    include ::mediawiki

    mysql::db { 'external store db':
        dbname  => 'external',
        options => 'DEFAULT CHARACTER SET binary',
    }

    mysql::sql { "GRANT ALL PRIVILEGES ON ${db_name}.* TO ${db_user}@${grant_db_host}":
        unless  => "SELECT 1 FROM INFORMATION_SCHEMA.SCHEMA_PRIVILEGES WHERE TABLE_SCHEMA = '${db_name}' AND GRANTEE = \"'${db_user}'@'${grant_db_host}'\" LIMIT 1",
        require => Mysql::User[$db_user],
    }

    mysql::sql { 'create ExternalStore table':
        sql     => "USE ${db_name}; SOURCE ${::mediawiki::dir}/maintenance/storage/blobs.sql;",
        unless  => "SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = '${db_name}' AND table_name = 'blobs';",
        require => Mysql::Db['external store db'],
    }

    mediawiki::settings { 'external store settings':
        values => template('role/externalstore/conf.php.erb'),
    }
}