Puppet Class: wazuh::wazuh_api

Defined in:
manifests/wazuh_api.pp

Overview

Wazuh App Copyright © 2019 Wazuh Inc. (License GPLv2) Wazuh API installation

Parameters:

  • wazuh_api_package (Any) (defaults to: 'wazuh-api')
  • wazuh_api_service (Any) (defaults to: 'wazuh-api')
  • wazuh_api_version (Any) (defaults to: '3.9.4-1')
  • nodejs_package (Any) (defaults to: 'nodejs')


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

class wazuh::wazuh_api (

  $wazuh_api_package = 'wazuh-api',
  $wazuh_api_service = 'wazuh-api',
  $wazuh_api_version = '3.9.4-1',

  $nodejs_package = 'nodejs'

){

  if $::osfamily == 'Debian' {
    exec { 'Updating repositories...':
      path    => '/usr/bin',
      command => 'curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -',

    }
    package { $nodejs_package:
      provider => 'apt',
    }
    package { $wazuh_api_package:
      ensure   => $wazuh_api_version,
      provider => 'apt',
    }

  }else{
    exec { 'Updating repositories...':
      path    => '/usr/bin',
      command => 'curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -',

    }
    package { $nodejs_package:
      provider => 'yum',
    }
    package { $wazuh_api_package:
      ensure   => $wazuh_api_version,
      provider => 'yum',
    }
  }

  service { 'wazuh-api':
    ensure   => running,
    enable   => true,
    provider => 'systemd',
  }


}