Puppet Class: db2_profile::database::db_tablespaces

Defined in:
manifests/database/db_tablespaces.pp

Summary

This class allows you to specify what DB2 database tablespace you want to define on your databases.

Overview

db2_profile::database::db_tablespaces

Check the documentation of [db2_tablespace](/docs/db2_config/db2_tablespace) on how to do this and what properties you can define on an tablespace.

See the file “LICENSE” for the full license governing this code.

Parameters:

  • list (Hash)

    The list of [db2_tablespace](/docs/db2_config/db2_tablespace. html) tablespaces you want ‘db2_profile::database` to create and manage for you.



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
# File 'manifests/database/db_tablespaces.pp', line 14

class db2_profile::database::db_tablespaces (
  Hash  $list,
) {
  easy_type::debug_evaluation() # Show local variable on extended debug

  # This is a simple way to get started. It is easy to get started, but
  # soon your hiera yaml becomes a nigtmare. Our advise is when you need
  # to let Puppet manage your DB2 users, to override this class and 
  # add your own Puppet implementation. This is a much better, more
  # maintainable, and adds more consistency.
  #
  db2_config::databases_in($list).each |$database| {
    if ! db2_config::is_standby($database) {
      $list = db2_config::resources_for($list, $database)
      if $list.keys.size > 0 {
        echo { "Ensure DB tablespace(s) ${list.keys.join(',')}":
          withpath => false,
        }
      }
      ensure_resources(db2_tablespace, $list)
    } else {
      if $list.keys.size > 0 {
        echo { "Skipping DB2 tablespaces(s) on ${database} because it is in standby mode": withpath => false }
      }
    }
  }
}