diff --git a/manifests/init.pp b/manifests/init.pp index 1998ae9288d14239414aa488bc7fc3da1e61eabf..bd8497e39668b07ab615555075f5f287187ec9d6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -38,8 +38,12 @@ import "nsc-puppet-utils" /* * Configure node to be a TSM client. * - * It is currently forbidden to use this define more than once for - * a node, even if you use different names. + * It is allowed to use this definition multiple times (with different + * 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' * for configuration, defining the following class variables: @@ -193,22 +197,18 @@ define tsmclient($serveraddress, $nodename=$fqdn, } file { - "${tsmdir}/bin/dsm.opt": - 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": + "${tsmdir}/bin/include_exclude.${tsm_servername}": ensure => file, content => template('tsmclient/include_exclude.erb'), owner => 'root', group => 'root', mode => 0444, 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 include tsmclient::vars include tsmclient::siteconfig + $tsmdir = $tsmclient::vars::tsmdir $tsmpassworddir = $tsmclient::vars::tsmpassworddir package { @@ -332,6 +333,18 @@ class tsmclient::install owner => 'root', group => 'root', mode => 0644, 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 diff --git a/templates/dsm.opt.erb b/templates/dsm.opt.erb index eea088899b3bc68131f1f37bd6e9ee423f9cbbcb..38f0b0e0e741a95517da27998bf28d6b1bc62ca6 100644 --- a/templates/dsm.opt.erb +++ b/templates/dsm.opt.erb @@ -25,4 +25,4 @@ options.merge!(mandatory) SERVERNAME <%= tsm_servername.upcase %> <% options.keys.sort.each do |optname| -%> <%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %> -<% end -%> +<% end %> diff --git a/templates/dsm.sys.erb b/templates/dsm.sys.erb index cbe51999507a51fcf2911bccaf558186bf21af78..ec61a594fcf0ed8bae878d09dc545814c0b61c07 100644 --- a/templates/dsm.sys.erb +++ b/templates/dsm.sys.erb @@ -8,7 +8,7 @@ mandatory = { 'commmethod' => "tcpip", 'tcpserveraddress' => tsm_serveraddress, 'passworddir' => "#{tsmpassworddir}/", - 'inclexcl' => "#{tsmdir}/bin/include_exclude", + 'inclexcl' => "#{tsmdir}/bin/include_exclude.#{tsm_servername}", } options = { } @@ -31,4 +31,4 @@ SERVERNAME <%= tsm_servername.upcase %> NODENAME <%= tsm_nodename %> <% options.keys.sort.each do |optname| -%> <%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %> -<% end -%> +<% end %>