Puppet Class: cognos::install::main

Defined in:
manifests/install/main.pp

Overview



2
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
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
90
# File 'manifests/install/main.pp', line 2

class cognos::install::main {

  # variables for response file
  if $cognos::install_app_tier {
    $install_app_tier_int = 1
  } else {
    $install_app_tier_int = 0
  }
  if $cognos::install_gateway {
    $install_gateway_int = 1
  } else {
    $install_gateway_int = 0
  }

  # Input validation
  validate_legacy(
    Optional[String],
    'validate_re',
    $cognos::cognos_user,
    '^[a-zA-Z0-9]{1,8}$',   # CHAR(8) && !/w && ![A-Z]
  )
  validate_legacy(
    Optional[String],
    'validate_re',
    $cognos::cognos_db_user,
    '^[a-zA-Z0-9_]{1,8}$',   # CHAR(8) && !/w && ![A-Z]
  )

  # If we're not in vagrant, then assert that our passwords aren't 'vagrant'.
  if str2bool($::is_vagrant) != true {
    validate_legacy(
      Optional[String],
      'validate_re',
      $cognos::cognos_user,
      '^(?!vagrant$).*$',
    )

    validate_legacy(
      Optional[String],
      'validate_re',
      $cognos::cognos_db_user,
      '^(?!vagrant$).*$',
    )

    validate_legacy(
      Optional[String],
      'validate_re',
      $cognos::cog_users_password_salt,
      '^(?!vagrant$).*$',
    )
  }

  # Cognos response file
  $response_file_name = "${cognos::installer_source_dir}/cognos_11_installer.properties"
  file{$response_file_name:
    content => template('cognos/cognos_11.rsp.erb'),
    mode    => '0755',
  }

  # Install Cognos
  $cog_install_cmd = @("END_COG_INSTALL_CMD"/$)
  export LAX_DEBUG=true
  ${cognos::installer_source_dir}/${cognos::installer_filename} -f ${response_file_name} -i silent
  | END_COG_INSTALL_CMD

  $cog_unless_cmd = @("END_COG_UNLESS_CMD"/$)
  test -f ${cognos::installer_target_dir}/cmplst.txt && \
  cat ${cognos::installer_target_dir}/cmplst.txt | grep -i PSPORTLETS_name=IBM\ Cognos\ Portal\ Services
  | END_COG_UNLESS_CMD

  exec{'install_cognos':
    command  => $cog_install_cmd,
    provider => 'shell',
    cwd      => $cognos::installer_source_dir,
    timeout  => $cognos::installer_timeout,
    unless   => $cog_unless_cmd,
    require  => [
      File[$response_file_name],
    ],
    before   => Exec['chown_cognos_install_dir'],
  }

  exec{'chown_cognos_install_dir':
    command  => "chown -R ${cognos::cognos_user}:${cognos::cognos_user} /opt/ibm/cognos",
    unless   => "ls -l ${cognos::installer_target_dir} | grep \"${cognos::cognos_user}\\:${cognos::cognos_user}\"",
    provider => 'shell',
  }

}