Maintenance: GitLab GKE platform upgrade and software upgrade on Friday Oct. 22 at 9 p.m. Service may not be available between 9 p.m. and 9:20 p.m.

client.pp 1.46 KB
Newer Older
1
2
# Set up the out_of_date client, which reports package status to the server.

Adam Lewenberg's avatar
Adam Lewenberg committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# $platform: should be one 'production' or 'development'.

class base::out_of_date::client (
  $ensure              = 'present',
  $platform            = 'production',
  $ood_server_override = undef,
){
  if ($ensure == 'present') {
    # PRESENT

    # Determine the server to use.
    if ($ood_server_override) {
      $ood_server = $ood_server_override
    } else {
      case $platform {
        'production':  { $ood_server = 'frankoz1.stanford.edu' }
        'development': { $ood_server = 'frankoz1.stanford.edu' }
        default:       { fail("unrecognized platform") }
      }
    }

24
25
26
27
28
    package { 'stanford-outofdate-client':
        ensure => installed,
    }

    file {
Adam Lewenberg's avatar
Adam Lewenberg committed
29
30
31
32
33
34
35
      '/etc/out-of-date':
        ensure  => directory,
        owner   => root,
        group   => root;
      '/etc/out-of-date/client.conf':
        content => template('base/out_of_date/etc/out-of-date/client.conf.erb'),
        require => Package['stanford-outofdate-client'];
36
37
    }

Adam Lewenberg's avatar
Adam Lewenberg committed
38
39
    file { '/etc/cron.hourly/out-of-date':
      source => 'puppet:///modules/base/out-of-date/etc/cron.hourly/out-of-date',
40
    }
Adam Lewenberg's avatar
Adam Lewenberg committed
41
42
  } else {
    # ABSENT
43

Adam Lewenberg's avatar
Adam Lewenberg committed
44
45
    package { 'stanford-outofdate-client':
      ensure => absent,
46
47
    }

Adam Lewenberg's avatar
Adam Lewenberg committed
48
49
50
51
52
53
54
55
56
    file { '/etc/cron.hourly/out-of-date':
      ensure => absent
    }

    file {
      '/etc/out-of-date':
        ensure  => absent;
      '/etc/out-of-date/client.conf':
        ensure  => absent;
57
    }
Adam Lewenberg's avatar
Adam Lewenberg committed
58
  }
59
}