nosolutions / puppet-tsm

Install and manage TSM (Tivoli Storage Manager) client with puppet
GNU General Public License v3.0
13 stars 21 forks source link

config_hash issue #13

Closed paulbadcock closed 9 years ago

paulbadcock commented 9 years ago

Calling the TSM class with the following config_hash generates an event with the puppet catalog run:

class { 'tsm': tcp_server_address => 'tsm.tld', config_hash => { nodename => 'ahostname', }, }

Notice: /Stage[main]/Tsm::Config/Concat::Fragment[dsm_sys_template]/File[/var/lib/puppet/concat/_opt_tivoli_tsm_client_ba_bin_dsm.sys/fragments/01_dsm_systemplate]/content: content changed '{md5}ba21bdddbee6193ac8ac313d2c96b3ce' to '{md5}347f4486faadc018f49366595f5f2000' Notice: /Stage[main]/Tsm::Config/Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]/Exec[concat/opt/tivoli/tsm/client/ba/bin/dsm.sys]/returns: executed successfully Notice: /Stage[main]/Tsm::Config/Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]/Exec[concat_/opt/tivoli/tsm/client/ba/bin/dsm.sys]: Triggered 'refresh' from 1 events Notice: Finished catalog run in 1.48 seconds

But the generated /opt/tivoli/tsm/client/ba/bin/dsm.sys is missing content. If I modify the /opt/tivoli/tsm/client/ba/bin/dsm.sys.local with the same content "hostname: "hostname"" it also won't generate a line in the dsm.sys file.

Puppet version is: 3.6.2

tosmi commented 9 years ago

thanks for the report. could you tell me

so that i'm able to reproduce this issue eventually

thanks toni

paulbadcock commented 9 years ago

No problem thanks for looking into it:

I just install the modules from rpm's: sudo rpm -i gsk*.rpm TIVsm-API64.x86_64.rpm TIVsm-BA.x86_64.rpm

I actually noticed on the first run it will work if the class includes the data for example:

class { 'tsm':
  tcp_server_address => 'tsm.tld',
  config_hash => {
    nodename => 'ahostname',
  },
}

The nodename will be set under additional options:

nodename ahostname

Where it breaks is if you modify the class it won't update on subsequent runs:

class { 'tsm':
  tcp_server_address => 'tsm.tld',
  config_hash => {
    nodename => 'ahostname-test',
  },
}

It will trigger a resource update

Notice: /Stage[main]/Tsm::Config/Concat::Fragment[dsm_sys_template]/File[/var/lib/puppet/concat/_opt_tivoli_tsm_client_ba_bin_dsm.sys/fragments/01_dsm_systemplate]/content: content changed '{md5}9e6187fed3251799ef1c5d8c3760ee56' to '{md5}5ece73d45bf4abcd2f114a54b9294404' Notice: /Stage[main]/Tsm::Config/Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]/Exec[concat/opt/tivoli/tsm/client/ba/bin/dsm.sys]/returns: executed successfully Notice: /Stage[main]/Tsm::Config/Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]/Exec[concat_/opt/tivoli/tsm/client/ba/bin/dsm.sys]: Triggered 'refresh' from 1 events Notice: Finished catalog run in 0.42 seconds

But the dsm.sys will not update to the config_hash parameter:

nodename ahostname

Hopefully this helps out, Paul

paulbadcock commented 9 years ago

One more thing,

The fragment is updated but it never made it to the dsm.sys file.

[root@test7 puppet]# diff /opt/tivoli/tsm/client/ba/bin/dsm.sys /var/lib/puppet/concat/_opt_tivoli_tsm_client_ba_bin_dsm.sys/fragments/01_dsm_sys_template 13c13 < nodename ahostname
> nodename ahostname-test

Paul

tosmi commented 9 years ago

thanks for the detailed info. i'll try to reproduce this issue. hopefully i'll come back with a solution in the next days.

tosmi commented 9 years ago

ok, found the issue:

you have to set config_replace to true:

class { 'tsm':
  tcp_server_address => 'tsm.tld',
  config_replace => true,
  config_hash => {
    nodename => 'ahostname',
  },
}

per default the module only creates a dsm.sys if there is none, but does not replace an existing one. so if tsm 7.1 does not install a default dsm.sys, the first puppet run creates a new dsm.sys, but subsequent runs will not replace the old one. i'm super careful with replacing config files, as we use this module on old hosts where i don't want to overwrite old configs.

also note that i'm going to upload version 1.0.0 of this module soon, which also fixes some minor bugs and annoyances.

sorry for the confusion, i'm going to update the readme to make things more clear.

toni

paulbadcock commented 9 years ago

Excellent, that's exactly the issue.

I totally understand about being careful about the config files it's kind of a daunting thing to re-mediate systems into configuration management. I can appreciate the extra layers of protection.

Thanks again, Paul