Puppet Class: hanaexpress

Defined in:
manifests/init.pp

Summary

Setup SAP HANA Express hosting

Overview

Sets up basic things needed for SAP HANA Express hosting based on [the SAP HANA Tutorial for Docker](www.sap.com/developer/tutorials/hxe-ua-install-using-docker.html).

Parameters:

  • store_username (String)

    Username for the Docker store

  • store_password (String)

    Password for the Docker store

  • hana_data_path (String)

    Host path for persisting hana data

  • pass_is_hash (Boolean)

    Set to true, if the password is actually the password hash of the user

  • manage_service (Boolean)

    Manage a system service for each managed app



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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'manifests/init.pp', line 11

class hanaexpress (
  String $store_username,
  String $store_password,
  String $hana_data_path,
  Boolean $pass_is_hash,
  Boolean $manage_service,
) {

  # Set Sysctl host settings (based on Step 5 of https://www.sap.com/developer/tutorials/hxe-ua-install-using-docker.html)

  sysctl {
    'fs.file-max':
      value => '20000000'
  }

  sysctl {
    'fs.aio-max-nr':
      value => '262144'
  }

  sysctl {
    'vm.memory_failure_early_kill':
      value  => '1',
      silent => true,
  }

  sysctl {
    'vm.max_map_count':
      value => '135217728'
  }

  sysctl {
    'net.ipv4.ip_local_port_range':
      value => '40000 60999'
  }

  # Set up docker in general if not yet done (see https://github.com/puppetlabs/puppetlabs-docker/issues/461
  # and https://github.com/dodevops/puppet-hanaexpress/issues/1 for background)

  if !defined(Class['docker']) {
    include 'docker'
  }

  # Login to the Docker store to pull SAP Hana images

  if ($pass_is_hash) {
    docker::registry {
      'https://index.docker.io/v1/':
        username  => $store_username,
        pass_hash => $store_password
    }
  } else {
    docker::registry {
      'https://index.docker.io/v1/':
        username => $store_username,
        password => $store_password
    }
  }

  # Create the data persistence path

  file {
    $hana_data_path:
      ensure => 'directory'
  }

  # Support Hiera

  $_dbs = lookup({
    name          => 'hanaexpress-databases',
    merge         => 'hash',
    default_value => undef
  })

  if $_dbs {
    create_resources('hanaexpress::database', $_dbs)
  }

}