Overview

This is a highly customizable Puppet profile class to define an IBM DB2 database on your system. In it’s core just adding:

contain db2_profile::database

Is enough to get an IBM DB2 database running on your system.

But sometimes you have specific uses cases that are not handled well by the standard classes. This profile class allows you to add your own code to the execution.

Steps

Defining and starting an DB2 database on you system goes through several steps :

  • em_license (setup Enterprise Modules licenses)
  • setup (Setup DB2 including fact caching)
  • sysctl (Set required sysctl settings)
  • limits (Set required security limits)
  • groups_and_users (Ensure required OS groups and users)
  • packages (Ensure require OS packages)
  • firewall (Configure firewall for DB2 usage)
  • db_software (Install the DB2 software)
  • db_fixpack (Install the DB2 fixpack)
  • db_instance (Ensure DB2 instances)
  • db_definition (Ensure DB2 databases)
  • db_primary (Set the database as primary database when using HADR)
  • db_standby (Set the database as standby database when using HADR)
  • db_tablespaces (Ensure DB2 tablespaces)
  • db_users (Ensure DB2 users in database)
  • db_roles (Ensure DB2 roles)
  • db_groups (Ensure DB2 groups in database)
  • db_schemas (Ensure DB2 schemas)
  • db_startup (Esnure DB2 startup after reboot)

All these steps have a default implementation. This implementation is suitable to get started with. These classed all have parameters you can customize through hiera values. The defaults are specified in the module’s data/default.yaml file.

before classes

But sometimes this is not enough and you would like to add some extra definitions, you can, for example, add a Puppet class to be executed after the systctl stage is done and before the limits is done. You can do this by adding the next line to your yaml data:

db2_profile::database::before_sysctl:   my_profile::my_extra_class

after classes

You can do the same when you want to add code after one of the stage classes:

db2_profile::database::after_sysctl:   my_profile::my_extra_class

Skipping

Sometimes organisation use different modules and mechanisms to implement a feature and you want to skip the class:

db2_profile::database::sysctl:   skip

Replacing

Or provide your own implementation:

db2_profile::database::sysctl:   my_profile::my_own_implementation

This mechanism can be used for all named steps and makes it easy to move from an easy setup with a running standard database to a fully customized setup using a lot of your own classes plugged in.

Look at the description of the steps and their properties.

Attributes

Attribute Name Short Description
after_db_definition The name of the class you want to execute directly after the db_definition class.
after_db_fixpack The name of the class you want to execute directly after the db_fixpack class.
after_db_groups The name of the class you want to execute directly after the db_groups class.
after_db_instance The name of the class you want to execute directly after the db_instance class.
after_db_primary The name of the class you want to execute directly after the db_primary class.
after_db_roles The name of the class you want to execute directly after the db_roles class.
after_db_schemas The name of the class you want to execute directly after the db_schemas class.
after_db_software The name of the class you want to execute directly after the db_software class.
after_db_standby The name of the class you want to execute directly after the db_standby class.
after_db_startup The name of the class you want to execute directly after the db_startup class.
after_db_tablespaces The name of the class you want to execute directly after the db_tablespaces class.
after_db_users The name of the class you want to execute directly after the db_users class.
after_em_license The name of the class you want to execute directly after the em_license class.
after_fact_caching The name of the class you want to execute directly after the fact_caching class.
after_firewall The name of the class you want to execute directly after the firewall class.
after_groups_and_users The name of the class you want to execute directly after the groups_and_users class.
after_limits The name of the class you want to execute directly after the limits class.
after_pacemaker_setup The name of the class you want to execute directly after the pacemaker_setup class.
after_packages The name of the class you want to execute directly after the packages class.
after_passwordless_root The name of the class you want to execute directly after the passwordless_root class.
after_sysctl The name of the class you want to execute directly after the sysctl class.
before_db_definition The name of the class you want to execute directly before the db_definitio class.
before_db_fixpack The name of the class you want to execute directly before the db_fixpack class.
before_db_groups The name of the class you want to execute directly before the db_groups class.
before_db_instance The name of the class you want to execute directly before the db_instance class.
before_db_primary The name of the class you want to execute directly before the db_primary class.
before_db_roles The name of the class you want to execute directly before the db_roles class.
before_db_schemas The name of the class you want to execute directly before the db_schemas class.
before_db_software The name of the class you want to execute directly before the db_software class.
before_db_standby The name of the class you want to execute directly before the db_standby class.
before_db_startup The name of the class you want to execute directly before the db_startup class.
before_db_tablespaces The name of the class you want to execute directly before the db_tablespaces class.
before_db_users The name of the class you want to execute directly before the db_users class.
before_em_license The name of the class you want to execute directly before the em_license class.
before_fact_caching The name of the class you want to execute directly before the fact_caching class.
before_firewall The name of the class you want to execute directly before the firewall class.
before_groups_and_users The name of the class you want to execute directly before the groups_and_users class.
before_limits The name of the class you want to execute directly before the limits class.
before_pacemaker_setup The name of the class you want to execute directly before the pacemaker_setup class.
before_packages The name of the class you want to execute directly before the packages class.
before_passwordless_root The name of the class you want to execute directly before the passwordless_root class.
before_sysctl The name of the class you want to execute directly before the sysctl class.
cluster_manager The cluster manager to apply when using a HADR setup.
db_definition Use this value if you want to skip or use your own class for stage db_definition.
db_fixpack Use this value if you want to skip or use your own class for stage db_fixpack.
db_groups Use this value if you want to skip or use your own class for stage db_groups.
db_instance Use this value if you want to skip or use your own class for stage db_instance.
db_primary Use this value if you want to skip or use your own class for stage db_primary.
db_roles Use this value if you want to skip or use your own class for stage db_roles.
db_schemas Use this value if you want to skip or use your own class for stage db_schemas.
db_software Use this value if you want to skip or use your own class for stage db_software.
db_standby Use this value if you want to skip or use your own class for stage db_standby.
db_startup Use this value if you want to skip or use your own class for stage db_startup.
db_tablespaces Use this value if you want to skip or use your own class for stage db_tablespaces.
db_users Use this value if you want to skip or use your own class for stage db_users.
em_license Use this value if you want to skip or use your own class for stage em_license.
fact_caching Use this value if you want to skip or use your own class for stage fact_caching.
firewall Use this value if you want to skip or use your own class for stage firewall.
groups_and_users Use this value if you want to skip or use your own class for stage groups_and_users.
limits Use this value if you want to skip or use your own class for stage limits.
pacemaker_setup Use this value if you want to skip or use your own class for stage pacemaker_setup.
packages Use this value if you want to skip or use your own class for stage packages.
passwordless_root Use this value if you want to skip or use your own class for stage limits.
primary The full qualified host name of the node you wan to use as primary DB2 node.
sysctl Use this value if you want to skip or use your own class for stage sysctl.

cluster_manager

The cluster manager to apply when using a HADR setup. At this point in time only the Pacemaker cluster manager is supported.

When you leave this paramater undefined, no cluster manager is applied. Type: Optional[String]

Default:undef

Back to overview of database

passwordless_root

Use this value if you want to skip or use your own class for stage limits.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::passwordless_root:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::passwordless_root:  skip

Type: Optional[String]

Default:undef

Back to overview of database

before_passwordless_root

The name of the class you want to execute directly before the passwordless_root class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_passwordless_root:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_passwordless_root

The name of the class you want to execute directly after the passwordless_root class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_passwordless_root:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

pacemaker_setup

Use this value if you want to skip or use your own class for stage pacemaker_setup.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::pacemaker_setup:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::pacemaker_setup:  skip

Type: Optional[String]

Default:undef

Back to overview of database

before_pacemaker_setup

The name of the class you want to execute directly before the pacemaker_setup class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_pacemaker_setup:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_pacemaker_setup

The name of the class you want to execute directly after the pacemaker_setup class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_pacemaker_setup:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_primary

The name of the class you want to execute directly after the db_primary class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_primary:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_standby

The name of the class you want to execute directly after the db_standby class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_primary:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_primary

The name of the class you want to execute directly before the db_primary class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_primary:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_standby

The name of the class you want to execute directly before the db_standby class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_standby:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

db_primary

Use this value if you want to skip or use your own class for stage db_primary.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_primary:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_primary:  skip

Type: Optional[String]

Default:undef

Back to overview of database

db_standby

Use this value if you want to skip or use your own class for stage db_standby.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_standby:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_standby:  skip

Type: Optional[String]

Default:undef

Back to overview of database

primary

The full qualified host name of the node you wan to use as primary DB2 node.

When you specify this variable, Puppet will create a HADR DB2 configuration. When the current FQDN equals the name specfied here, Puppet will create a primary DB2 node. When the FQDN is different, Puppet will configure the node as a standby database.

You’ll have to ensure the the setting for the db2_database for all nodes are set correctly. These values are relevant:

  • hadr_local_host
  • hadr_local_svc
  • hadr_remote_host
  • hadr_remote_svc
  • hadr_remote_inst

Type: Optional[String[1]]

Default:undef

Back to overview of database

after_db_definition

The name of the class you want to execute directly after the db_definition class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_definition:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_fixpack

The name of the class you want to execute directly after the db_fixpack class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_fixpack:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_instance

The name of the class you want to execute directly after the db_instance class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_instance:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_roles

The name of the class you want to execute directly after the db_roles class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_roles:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_software

The name of the class you want to execute directly after the db_software class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_software:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_startup

The name of the class you want to execute directly after the db_startup class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_startup:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_tablespaces

The name of the class you want to execute directly after the db_tablespaces class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_tablespaces:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_users

The name of the class you want to execute directly after the db_users class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_users:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_groups

The name of the class you want to execute directly after the db_groups class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_groups:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_db_schemas

The name of the class you want to execute directly after the db_schemas class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_db_schemas:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_em_license

The name of the class you want to execute directly after the em_license class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_em_license:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_fact_caching

The name of the class you want to execute directly after the fact_caching class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_fact_caching:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_firewall

The name of the class you want to execute directly after the firewall class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_firewall:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_groups_and_users

The name of the class you want to execute directly after the groups_and_users class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_groups_and_users:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_limits

The name of the class you want to execute directly after the limits class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_limits:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_packages

The name of the class you want to execute directly after the packages class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_packages:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

after_sysctl

The name of the class you want to execute directly after the sysctl class.

You can use hiera to set this value. Here is an example:

db2_profile::database::after_sysctl:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_definition

The name of the class you want to execute directly before the db_definitio class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_definitio:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_fixpack

The name of the class you want to execute directly before the db_fixpack class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_fixpack:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_instance

The name of the class you want to execute directly before the db_instance class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_instance:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_roles

The name of the class you want to execute directly before the db_roles class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_roles:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_software

The name of the class you want to execute directly before the db_software class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_software:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_startup

The name of the class you want to execute directly before the db_startup class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_startup:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_schemas

The name of the class you want to execute directly before the db_schemas class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_schemas:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_tablespaces

The name of the class you want to execute directly before the db_tablespaces class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_tablespaces:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_users

The name of the class you want to execute directly before the db_users class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_users:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_db_groups

The name of the class you want to execute directly before the db_groups class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_db_groups:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_em_license

The name of the class you want to execute directly before the em_license class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_em_license:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_fact_caching

The name of the class you want to execute directly before the fact_caching class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_fact_caching:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_firewall

The name of the class you want to execute directly before the firewall class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_firewall:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_groups_and_users

The name of the class you want to execute directly before the groups_and_users class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_groups_and_users:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_limits

The name of the class you want to execute directly before the limits class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_limits:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_packages

The name of the class you want to execute directly before the packages class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_packages:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

before_sysctl

The name of the class you want to execute directly before the sysctl class.

You can use hiera to set this value. Here is an example:

db2_profile::database::before_sysctl:  my_module::my_class

Type: Optional[String]

Default:undef

Back to overview of database

db_definition

Use this value if you want to skip or use your own class for stage db_definition.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_definition:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_definition:  skip

Type: Optional[String]

Default:undef

Back to overview of database

db_fixpack

Use this value if you want to skip or use your own class for stage db_fixpack.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_fixpack:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_fixpack:  skip

Type: Optional[String]

Default:undef

Back to overview of database

db_instance

Use this value if you want to skip or use your own class for stage db_instance.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_instance:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_instance:  skip

Type: Optional[String]

Default:undef

Back to overview of database

db_roles

Use this value if you want to skip or use your own class for stage db_roles.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_roles:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_roles:  skip

Type: Optional[String]

Default:undef

Back to overview of database

db_groups

Use this value if you want to skip or use your own class for stage db_groups.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_groups:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_groups:  skip

Type: Optional[String]

Default:undef

Back to overview of database

db_schemas

Use this value if you want to skip or use your own class for stage db_schemas.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_schemas:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_schemas:  skip

Type: Optional[String]

Default:undef

Back to overview of database

db_software

Use this value if you want to skip or use your own class for stage db_software.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_software:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_software:  skip

Type: Optional[String]

Default:undef

Back to overview of database

db_startup

Use this value if you want to skip or use your own class for stage db_startup.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_startup:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_startup:  skip

Type: Optional[String]

Default:undef

Back to overview of database

db_tablespaces

Use this value if you want to skip or use your own class for stage db_tablespaces.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_tablespaces:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_tablespaces:  skip

Type: Optional[String]

Default:undef

Back to overview of database

db_users

Use this value if you want to skip or use your own class for stage db_users.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::db_users:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::db_users:  skip

Type: Optional[String]

Default:undef

Back to overview of database

em_license

Use this value if you want to skip or use your own class for stage em_license.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::em_license:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::em_license:  skip

Type: Optional[String]

Default:undef

Back to overview of database

fact_caching

Use this value if you want to skip or use your own class for stage fact_caching.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::fact_caching:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::fact_caching:  skip

Type: Optional[String]

Default:undef

Back to overview of database

firewall

Use this value if you want to skip or use your own class for stage firewall.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::firewall:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::firewall:  skip

Type: Optional[String]

Default:undef

Back to overview of database

groups_and_users

Use this value if you want to skip or use your own class for stage groups_and_users.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::groups_and_users:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::groups_and_users:  skip

Type: Optional[String]

Default:undef

Back to overview of database

limits

Use this value if you want to skip or use your own class for stage limits.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::limits:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::limits:  skip

Type: Optional[String]

Default:undef

Back to overview of database

packages

Use this value if you want to skip or use your own class for stage packages.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::packages:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::packages:  skip

Type: Optional[String]

Default:undef

Back to overview of database

sysctl

Use this value if you want to skip or use your own class for stage sysctl.

Use your own class

You can use hiera to set this value. Here is an example:

db2_profile::database::sysctl:  my_module::my_class

Skip

You can use hiera to set this value. Here is an example:

db2_profile::database::sysctl:  skip

Type: Optional[String]

Default:undef

Back to overview of database