Puppet Class: dcos::master

Inherits:
::dcos
Defined in:
manifests/master.pp

Overview

DC/OS master node

Parameters:

  • mesos (Any) (defaults to: {})
  • manage_adminrouter (Any) (defaults to: false)
  • service_name (Any) (defaults to: 'dcos-mesos-master')
  • adminrouter (Any) (defaults to: {})


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
# File 'manifests/master.pp', line 3

class dcos::master (
  $mesos = {},
  $manage_adminrouter = false,
  $service_name = 'dcos-mesos-master',
  $adminrouter = {}
) inherits ::dcos {

  anchor { 'dcos::master::installed': }

  if $::dcos::bootstrap_url {
    exec { 'dcos master install':
      command     => "bash ${::dcos::download_dir}/dcos_install.sh master",
      path        => '/bin:/usr/bin:/usr/sbin',
      onlyif      => 'test ! -d /opt/mesosphere',
      refreshonly => false,
      before      => Anchor['dcos::master::installed'],
    }
  }

  case $::osfamily {
    'Debian': {
      # needed for DC/OS < 1.11
      # make sure to try system library first
      file_line { 'update LD_PATH /opt/mesosphere/environment':
        path    => '/opt/mesosphere/environment',
        line    => 'LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/mesosphere/lib',
        match   => '^LD_LIBRARY_PATH=*',
        replace => true,
        require => Anchor['dcos::master::installed'],
      }
    }
    default: { }
  }

  if $manage_adminrouter {
    class{'::dcos::adminrouter':
      config  => $adminrouter,
      require => Anchor['dcos::master::installed'],
    }
  }

  file {'/opt/mesosphere/etc/mesos-master-extras':
    ensure  => 'present',
    content => template('dcos/master-extras.erb'),
    notify  => Service[$service_name],
  }

  service { $service_name:
    ensure     => 'running',
    hasstatus  => true,
    hasrestart => true,
    enable     => true,
    require    => [File['/opt/mesosphere/etc/mesos-master-extras'],Anchor['dcos::master::installed']],
  }

}