Puppet Class: profile::labs::db::views

Defined in:
modules/profile/manifests/labs/db/views.pp

Overview

deploy scripts and its dependencies to create replica views

Parameters:

  • view_user (Any) (defaults to: hiera('profile::labs::db::views::maintainviews::user'))
  • view_pass (Any) (defaults to: hiera('profile::labs::db::views::maintainviews::db_pass'))
  • idx_user (Any) (defaults to: hiera('profile::labs::db::views::maintainindexes::user'))
  • idx_pass (Any) (defaults to: hiera('profile::labs::db::views::maintainindexes::db_pass'))


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
61
62
63
64
65
66
67
68
69
70
71
72
# File 'modules/profile/manifests/labs/db/views.pp', line 2

class profile::labs::db::views (
    $view_user = hiera('profile::labs::db::views::maintainviews::user'),
    $view_pass = hiera('profile::labs::db::views::maintainviews::db_pass'),
    $idx_user = hiera('profile::labs::db::views::maintainindexes::user'),
    $idx_pass = hiera('profile::labs::db::views::maintainindexes::db_pass'),
){

    package { [
        'python-pymysql',
        'python-requests',
        'python-simplejson',
        'python3-psutil'
    ]:
        ensure => present,
    }

    file { '/etc/maintain-views.yaml':
        ensure  => file,
        content => template('profile/labs/db/views/maintain-views.yaml'),
        owner   => 'root',
        group   => 'root',
        mode    => '0400',
    }

    file { '/usr/local/sbin/maintain-views':
        ensure  => file,
        source  => 'puppet:///modules/profile/labs/db/views/maintain-views.py',
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        require => [Package['python3-yaml', 'python3-pymysql'],
                    Git::Clone['operations/mediawiki-config'],
        ],
    }

    file { '/etc/index-conf.yaml':
        ensure  => file,
        content => template('profile/labs/db/views/index-conf.yaml'),
        owner   => 'root',
        group   => 'root',
        mode    => '0400',
    }

    file { '/usr/local/sbin/maintain-replica-indexes':
        ensure  => file,
        source  => 'puppet:///modules/profile/labs/db/views/maintain_replica_indexes.py',
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        require => [Package['python3-yaml', 'python3-pymysql', 'python3-psutil'],
                    Git::Clone['operations/mediawiki-config'],
        ],
    }

    file { '/usr/local/sbin/maintain-meta_p':
        ensure  => file,
        source  => 'puppet:///modules/profile/labs/db/views/maintain-meta_p.py',
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        require => [Package['python-simplejson', 'python-pymysql']],
    }

    file { '/usr/local/src/heartbeat-views.sql':
        ensure => file,
        source => 'puppet:///modules/profile/labs/db/views/heartbeat-views.sql',
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
    }
}