Puppet Class: wdqs::deploy::autodeploy

Defined in:
modules/wdqs/manifests/deploy/autodeploy.pp

Overview

the wdqs package is cloned from git and kept up to date via a cron

Parameters:

  • deploy_user (String)
  • package_dir (Stdlib::Absolutepath)
  • autodeploy_log_dir (Stdlib::Absolutepath)


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
# File 'modules/wdqs/manifests/deploy/autodeploy.pp', line 2

class wdqs::deploy::autodeploy(
    String $deploy_user,
    Stdlib::Absolutepath $package_dir,
    Stdlib::Absolutepath $autodeploy_log_dir
){

    class { '::wdqs::deploy::manual':
        deploy_user => $deploy_user,
        package_dir => $package_dir,
    }

    file { $autodeploy_log_dir:
        ensure => directory,
        owner  => $deploy_user,
        group  => 'root',
        mode   => '0775',
    }

    $wdqs_autodeployment_log = "${$autodeploy_log_dir}/wdqs_autodeployment.log"

    file { '/usr/local/bin/wdqs-autodeploy':
        ensure => present,
        source => 'puppet:///modules/wdqs/cron/wdqs-autodeploy.sh',
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
    }

    cron { 'wdqs-autodeploy':
        ensure  => present,
        command => "/usr/local/bin/wdqs-autodeploy ${package_dir} >> ${$wdqs_autodeployment_log} 2>&1",
        user    => $deploy_user,
        minute  => 0,
        hour    => [5, 11, 17, 23],
    }

    logrotate::rule { 'wdqs_autodeployment_log':
        ensure       => present,
        file_glob    => $wdqs_autodeployment_log,
        frequency    => 'daily',
        missing_ok   => true,
        not_if_empty => true,
        rotate       => 30,
        compress     => true,
    }

}