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

Make it possible to declare multiple TSM servers.

This change makes it possible to have multiple tsmclient declarations,
each generating its own section in dsm.sys and dsm.opt, and each
having its own include/exclude list.
parent 0a8377e6
No related branches found
No related tags found
No related merge requests found
...@@ -38,8 +38,12 @@ import "nsc-puppet-utils" ...@@ -38,8 +38,12 @@ import "nsc-puppet-utils"
/* /*
* Configure node to be a TSM client. * Configure node to be a TSM client.
* *
* It is currently forbidden to use this define more than once for * It is allowed to use this definition multiple times (with different
* a node, even if you use different names. * names), in which case dsm.sys and dsm.opt will contain all the
* declared servers with their respective configurations. Unconfiguring
* a server is done by just not declaring it in the manifests anymore.
* There is however no way of declaring which of the servers should be
* the default server.
* *
* The caller must provide a class named 'tsmclient::siteconfig' * The caller must provide a class named 'tsmclient::siteconfig'
* for configuration, defining the following class variables: * for configuration, defining the following class variables:
...@@ -193,22 +197,18 @@ define tsmclient($serveraddress, $nodename=$fqdn, ...@@ -193,22 +197,18 @@ define tsmclient($serveraddress, $nodename=$fqdn,
} }
file { file {
"${tsmdir}/bin/dsm.opt": "${tsmdir}/bin/include_exclude.${tsm_servername}":
ensure => file,
content => template('tsmclient/dsm.opt.erb'),
owner => 'root', group => 'root', mode => 0444,
require => Package['TIVsm-BA'], notify => Service['dsmcad'];
"${tsmdir}/bin/dsm.sys":
ensure => file,
content => template('tsmclient/dsm.sys.erb'),
owner => 'root', group => 'root', mode => 0444,
require => Package['TIVsm-BA'], notify => Service['dsmcad'];
"${tsmdir}/bin/include_exclude":
ensure => file, ensure => file,
content => template('tsmclient/include_exclude.erb'), content => template('tsmclient/include_exclude.erb'),
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'];
} }
concat_part {
"${tsmdir}/bin/dsm.opt/${tsm_servername}":
content => template('tsmclient/dsm.opt.erb');
"${tsmdir}/bin/dsm.sys/${tsm_servername}":
content => template('tsmclient/dsm.sys.erb');
}
} }
...@@ -302,6 +302,7 @@ class tsmclient::install ...@@ -302,6 +302,7 @@ class tsmclient::install
include tsmclient::vars include tsmclient::vars
include tsmclient::siteconfig include tsmclient::siteconfig
$tsmdir = $tsmclient::vars::tsmdir
$tsmpassworddir = $tsmclient::vars::tsmpassworddir $tsmpassworddir = $tsmclient::vars::tsmpassworddir
package { package {
...@@ -332,6 +333,18 @@ class tsmclient::install ...@@ -332,6 +333,18 @@ class tsmclient::install
owner => 'root', group => 'root', mode => 0644, owner => 'root', group => 'root', mode => 0644,
require => Package['TIVsm-BA'], notify => Service['dsmcad']; require => Package['TIVsm-BA'], notify => Service['dsmcad'];
# Remnants from older versions of the tsmclient definition
"${tsmdir}/bin/include_exclude":
ensure => absent;
}
concat_file {
"${tsmdir}/bin/dsm.opt":
owner => 'root', group => 'root', mode => 0444,
require => Package['TIVsm-BA'], notify => Service['dsmcad'];
"${tsmdir}/bin/dsm.sys":
owner => 'root', group => 'root', mode => 0444,
require => Package['TIVsm-BA'], notify => Service['dsmcad'];
} }
# Manage password file # Manage password file
......
...@@ -25,4 +25,4 @@ options.merge!(mandatory) ...@@ -25,4 +25,4 @@ options.merge!(mandatory)
SERVERNAME <%= tsm_servername.upcase %> SERVERNAME <%= tsm_servername.upcase %>
<% options.keys.sort.each do |optname| -%> <% options.keys.sort.each do |optname| -%>
<%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %> <%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %>
<% end -%> <% end %>
...@@ -8,7 +8,7 @@ mandatory = { ...@@ -8,7 +8,7 @@ mandatory = {
'commmethod' => "tcpip", 'commmethod' => "tcpip",
'tcpserveraddress' => tsm_serveraddress, 'tcpserveraddress' => tsm_serveraddress,
'passworddir' => "#{tsmpassworddir}/", 'passworddir' => "#{tsmpassworddir}/",
'inclexcl' => "#{tsmdir}/bin/include_exclude", 'inclexcl' => "#{tsmdir}/bin/include_exclude.#{tsm_servername}",
} }
options = { } options = { }
...@@ -31,4 +31,4 @@ SERVERNAME <%= tsm_servername.upcase %> ...@@ -31,4 +31,4 @@ SERVERNAME <%= tsm_servername.upcase %>
NODENAME <%= tsm_nodename %> NODENAME <%= tsm_nodename %>
<% options.keys.sort.each do |optname| -%> <% options.keys.sort.each do |optname| -%>
<%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %> <%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %>
<% end -%> <% end %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment