Skip to content
Snippets Groups Projects
Commit 0a8377e6 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Refactor: keep static parts outside tsmclient definition.

Resources and function calls that do not depend on the parameters
to the tsmclient definition are moved away from there and into the
tsmclient::install class.  This is in preparation for making it
possible to have multiple tsmclient declarations for a node.
parent 896f545d
No related branches found
No related tags found
No related merge requests found
...@@ -193,10 +193,6 @@ define tsmclient($serveraddress, $nodename=$fqdn, ...@@ -193,10 +193,6 @@ define tsmclient($serveraddress, $nodename=$fqdn,
} }
file { file {
$tsmpassworddir:
ensure => directory,
owner => 'root', group => 'root', mode => 0755,
require => Package['TIVsm-BA'];
"${tsmdir}/bin/dsm.opt": "${tsmdir}/bin/dsm.opt":
ensure => file, ensure => file,
content => template('tsmclient/dsm.opt.erb'), content => template('tsmclient/dsm.opt.erb'),
...@@ -213,23 +209,6 @@ define tsmclient($serveraddress, $nodename=$fqdn, ...@@ -213,23 +209,6 @@ define tsmclient($serveraddress, $nodename=$fqdn,
owner => 'root', group => 'root', mode => 0444, owner => 'root', group => 'root', mode => 0444,
require => Package['TIVsm-BA'], notify => Service['dsmcad']; require => Package['TIVsm-BA'], notify => Service['dsmcad'];
} }
$pw_save_file = $tsmclient::siteconfig::password_save_location
if $pw_save_file {
$pw_vsave_file = inline_template(
'<%= File.basename(pw_save_file) + ".%Y%m%d-%H%M%S" -%>')
store_versioned_data($tsm_password, $pw_save_file, $pw_vsave_file)
}
if $tsmclient::siteconfig::password_source {
file {
"${tsmpassworddir}/TSM.PWD":
ensure => file, links => follow, replace => false,
source => $tsmclient::siteconfig::password_source,
owner => 'root', group => 'root', mode => 0600,
notify => Service['dsmcad'];
}
}
} }
...@@ -320,12 +299,22 @@ class tsmclient::vars ...@@ -320,12 +299,22 @@ class tsmclient::vars
*/ */
class tsmclient::install class tsmclient::install
{ {
include tsmclient::vars
include tsmclient::siteconfig
$tsmpassworddir = $tsmclient::vars::tsmpassworddir
package { package {
[ 'TIVsm-BA', 'TIVsm-API64' ]: [ 'TIVsm-BA', 'TIVsm-API64' ]:
ensure => installed; ensure => installed;
} }
file { file {
$tsmpassworddir:
ensure => directory,
owner => 'root', group => 'root', mode => 0755,
require => Package['TIVsm-BA'];
'/etc/init.d/dsmcad': '/etc/init.d/dsmcad':
ensure => file, ensure => file,
owner => 'root', group => 'root', mode => 0555, owner => 'root', group => 'root', mode => 0555,
...@@ -344,6 +333,25 @@ class tsmclient::install ...@@ -344,6 +333,25 @@ class tsmclient::install
require => Package['TIVsm-BA'], notify => Service['dsmcad']; require => Package['TIVsm-BA'], notify => Service['dsmcad'];
} }
# Manage password file
$pw_save_file = $tsmclient::siteconfig::password_save_location
if $pw_save_file {
$pw_vsave_file = inline_template(
'<%= File.basename(pw_save_file) + ".%Y%m%d-%H%M%S" -%>')
store_versioned_data($tsm_password, $pw_save_file, $pw_vsave_file)
}
if $tsmclient::siteconfig::password_source {
file {
"${tsmpassworddir}/TSM.PWD":
ensure => file, links => follow, replace => false,
source => $tsmclient::siteconfig::password_source,
owner => 'root', group => 'root', mode => 0600,
notify => Service['dsmcad'];
}
}
service { service {
'dsmcad': 'dsmcad':
enable => true, ensure => $running, enable => true, ensure => $running,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment