Puppet Class: profile::idp::standalone

Defined in:
modules/profile/manifests/idp/standalone.pp

Overview



2
3
4
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'modules/profile/manifests/idp/standalone.pp', line 2

class profile::idp::standalone {
  ensure_packages(['python3-flask'])
  # Standard stuff
  include profile::base::production
  include profile::base::firewall

  # configure database
  include profile::mariadb::packages_wmf
  class {'mariadb::service': }
  class {'mariadb::config':
    basedir => '/usr',
    config  => 'role/mariadb/mysqld_config/misc.my.cnf.erb',
    datadir => '/srv/sqldata',
  }
  # TODO: configure openldap
  #  https://wikitech.wikimedia.org/wiki/Standalone-slapd

  # configure IDP
  include profile::idp
  include profile::java
  # Set up test web application
  $wsgi_file = '/usr/local/share/idp-test/wsgi.py'
  $simple_flask_debug_app = @("APP")
  from flask import Flask, request
  app = Flask(__name__)
  @app.route("/")
  def root():
    return '<br />'.join(['{}={}'.format(k,v) for k,v in request.environ.items()])
  application = app
  | APP

  # BUG: need to use dirname() vs dirname
  # https://github.com/rodjek/puppet-lint/issues/937
  file {$wsgi_file.dirname():
    ensure => directory,
  }
  file {$wsgi_file:
    ensure  => file,
    content => $simple_flask_debug_app,
  }
  uwsgi::app{'idp-test':
    settings => {
      uwsgi => {
        'plugins'     => 'python3',
        'master'      => true,
        'http-socket' => '127.0.0.1:8081',
        'wsgi-file'   => $wsgi_file,
        'die-on-term' => true,
      }
    }
  }

  class {'httpd': modules => ['proxy_http', 'proxy']}
  include profile::idp::client::httpd
  ferm::service {'http-idp-test-login':
    proto => 'tcp',
    port  => 80,
  }
}