Puppet Class: pulsar::install

Defined in:
manifests/install.pp

Overview

This class is called from the main pulsar class for install.



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
73
74
# File 'manifests/install.pp', line 5

class pulsar::install {
  assert_private('pulsar::install is a private class')
  File {
      owner  => $pulsar::pulsar_owner,
      group  => $pulsar::pulsar_group,
      mode   => $pulsar::pulsar_dirmode,
  }
  Python::Virtualenv {
      owner  => $pulsar::pulsar_owner,
      group  => $pulsar::pulsar_group,
      mode   => $pulsar::pulsar_dirmode,
  }

  if $pulsar::pulsar_pip_install {
    file { $pulsar::pulsar_dir:
      ensure => directory,
    }
    python::virtualenv { "${pulsar::pulsar_dir}/venv":
      ensure  => present,
      require => File[$pulsar::pulsar_dir],
    }
    $_requirements = $pulsar::pulsar_requirements
    file { "${pulsar::pulsar_dir}/requirements.txt":
      ensure  => present,
      mode    => $pulsar::pulsar_filemode,
      content => template('pulsar/requirements.txt.erb'),
      require => File[$pulsar::pulsar_dir],
    }
    python::requirements { 'pulsar_pip_requirements':
      requirements           => "${pulsar::pulsar_dir}/requirements.txt",
      virtualenv             => "${pulsar::pulsar_dir}/venv",
      owner                  => $pulsar::pulsar_owner,
      group                  => $pulsar::pulsar_group,
      cwd                    => "${pulsar::pulsar_dir}",
      manage_requirements    => false,
      fix_requirements_owner => true,
      log_dir                => "${pulsar::pulsar_dir}",
      require                => File["${pulsar::pulsar_dir}/requirements.txt"],
    }
  }
  else {
    vcsrepo { $pulsar::pulsar_dir:
      ensure   => present,
      provider => git,
      source   => $pulsar::pulsar_git_repository,
      revision => $pulsar::pulsar_git_revision,
      user     => $pulsar::pulsar_owner,
      owner    => $pulsar::pulsar_owner,
      group    => $pulsar::pulsar_group,
    }
    python::virtualenv { "${pulsar::pulsar_dir}/.venv":
      ensure  => present,
      require => Vcsrepo[$pulsar::pulsar_dir],
    }
    file { "${pulsar::pulsar_dir}/requirements.txt":
      ensure  => present,
      require => Vcsrepo[$pulsar::pulsar_dir],
    }
    python::requirements { 'pulsar_pip_requirements':
      requirements           => "${pulsar::pulsar_dir}/requirements.txt",
      virtualenv             => "${pulsar::pulsar_dir}/.venv",
      owner                  => $pulsar::pulsar_owner,
      group                  => $pulsar::pulsar_group,
      cwd                    => "${pulsar::pulsar_dir}",
      manage_requirements    => false,
      fix_requirements_owner => true,
      log_dir                => "${pulsar::pulsar_dir}",
    }
  }
}