Puppet Class: role::wsoauth

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

Overview

Class: role::wsoauth

Provisions the WSOAuth extension, which allows login via OAuth, using accounts at a remote wiki.

Parameters:

  • oauth_uri (Any)
  • oauth_key (Any)
  • oauth_secret (Any)
  • login_button_message_key (Any)


5
6
7
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
37
38
# File 'puppet/modules/role/manifests/wsoauth.pp', line 5

class role::wsoauth (
    $oauth_uri,
    $oauth_key,
    $oauth_secret,
    $login_button_message_key,
) {
    ensure_resource('mediawiki::extension', 'PluggableAuth')

    $mediawiki_url = lookup('mediawiki::server_url', {default_value => ''})

    mediawiki::extension { 'WSOAuth':
        needs_update => true,
        composer     => true,
        settings     => {
            wgPluggableAuth_Config => {
                mediawiki => {
                    plugin             => 'WSOAuth',
                    data               => {
                        type         => 'mediawiki',
                        uri          => $oauth_uri,
                        clientId     => $oauth_key,
                        clientSecret => $oauth_secret,
                        redirectUri  => "${mediawiki_url}/w/index.php?title=Special:PluggableAuthLogin",
                    },
                    buttonLabelMessage => $login_button_message_key,
                },
            },
        },
    }

    mediawiki::import::text { 'VagrantRoleWSOAuth':
        source => 'puppet:///modules/role/wsoauth/VagrantRoleWSOAuth.wiki',
    }
}