Puppet Class: profile::quarry::staging_configure

Defined in:
modules/profile/manifests/quarry/staging_configure.pp

Overview

Class: profile::quarry::staging_configure

Sets up a mysql database and configs for use by the Quarry staging node.

Parameters:

  • dbpass (String) (defaults to: lookup('profile::quarry::staging_configure::dbpass', {default_value => 'notarealpassword'}))
  • oauth_secret_token (String) (defaults to: lookup('profile::quarry::staging_configure::oauth_secret_token', {default_value => 'blank'}))
  • oauth_consumer_token (String) (defaults to: lookup('profile::quarry::staging_configure::oauth_consumer_token', {default_value => 'blank'}))
  • replicapass (String) (defaults to: lookup('profile::quarry::staging_configure::replica_password', {default_value => 'blank'}))
  • replicauser (String) (defaults to: lookup('profile::quarry::staging_configure::replica_user', {default_value => 'blank'}))


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
# File 'modules/profile/manifests/quarry/staging_configure.pp', line 5

class profile::quarry::staging_configure (
    String       $dbpass = lookup('profile::quarry::staging_configure::dbpass', {default_value => 'notarealpassword'}),
    String       $oauth_secret_token = lookup('profile::quarry::staging_configure::oauth_secret_token', {default_value => 'blank'}),
    String       $oauth_consumer_token = lookup('profile::quarry::staging_configure::oauth_consumer_token', {default_value => 'blank'}),
    String       $replicapass = lookup('profile::quarry::staging_configure::replica_password', {default_value => 'blank'}),
    String       $replicauser = lookup('profile::quarry::staging_configure::replica_user', {default_value => 'blank'}),
){
    file { ['/data', '/data/project']:
        ensure => directory,
        owner  => 'root',
        before => 'File[/data/project/quarry]'
    }

    file { '/srv/results':
        ensure => 'directory',
        owner  => 'quarry',
        group  => 'quarry',
        mode   => '0755',
    }

    exec {'import mysql':
        path    => '/usr/bin:/usr/sbin',
        command => 'mysql -u root < /srv/quarry/schema.sql',
        require => 'Exec[git_clone_analytics/quarry/web]',
    }

    file { '/srv/quarry/quarry/config.yaml':
        ensure  => file,
        content => template('quarry/staging_config.yaml.erb'),
        require => 'Exec[git_clone_analytics/quarry/web]',
    }

    file { '/root/staging_user.sql':
        ensure  => file,
        content => template('quarry/staging_user.sql.erb'),
        notify  => 'Exec[add quarry user]',
    }

    exec {'add quarry user':
        path        => '/usr/bin',
        command     => 'mysql -u root < /root/staging_user.sql',
        refreshonly => true,
    }
}