Puppet Class: threatstack::package

Defined in:
manifests/package.pp

Overview

Class: threatstack::package

Install Threat Stack Agent package.

Examples

class threatstack ( .. ) inherits threatstack::params { .. }

Authors

Pete Cheslock <pete.cheslock@threatstack.com> Tom McLaughlin <tom.mclaughlin@threatstack.com> Nate St. Germain <nate.stgermain@threatstack.com>

Copyright 2020 Threat Stack, Inc.



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

class threatstack::package {

  class { $::threatstack::repo_class: }

  if $::threatstack::disable_auditd {
    if defined(Service['auditd']) {
      fail('auditd is already defined or managed. please ensure the service is disabled and stopped before running Threatstack Agent.')
    } else {
      class {'auditd':
        manage_service => true,
        service_ensure => 'stopped',
        service_enable => false
      }
    }
      $required = [ Class[$::threatstack::repo_class], Service['auditd'] ]
    } else {
    $required = Class[$::threatstack::repo_class]
  }

  # NOTE: We do not signal the tsagent service to restart because the
  # package takes care of this.  The workflow differs between fresh
  # installation and upgrades.
  case $facts['os']['family'] {
    'Windows': {
      remote_file { 'agent msi download':
        ensure => present,
        path   => $::threatstack::windows_tmp_path,
        source => $::threatstack::windows_download_url
      }

      if $::threatstack::enable_sysmon {
          include threatstack::sysmon
      }

      package { $::threatstack::ts_package:
        ensure          => installed,
        source          => $::threatstack::windows_tmp_path,
        install_options => $::threatstack::windows_install_options,
        require         => [Exec['Install sysmon'], Remote_file['agent msi download']]
      }
    }
    default: {
      package { $::threatstack::ts_package:
        ensure  => $::threatstack::package_version,
        require => $required
      }
    }
  }
}