voxpupuli / puppet-bareos

Puppet Module to manage bareos
https://forge.puppetlabs.com/project0/bareos
Apache License 2.0
13 stars 36 forks source link

Upgrade of fd fails on Ubuntu Xenial #25

Closed amorphina closed 6 years ago

amorphina commented 6 years ago

Upgrade from 16.2 to 17.2 fails because of an existing client config in the /etc/bareos/bareos-fd.d/client, whose name is $(hostname).conf During the upgrade the file myself.conf is created in that directory and in this case 2 files have one and the same client definition, thus the bareos-fd process does not start and the install does not complete successfully. Maybe it is possible to make the file bareos/manifests/client/client.pp to have variable name for the bottom part:

file { "${::bareos::client::config_dir}/${_resource_dir}/${name_client}.conf": -> file { "${::bareos::client::config_dir}/${_resource_dir}/myself.conf":

...or use a variable for it.

Error that is produced:

root@server:/etc/bareos/bareos-fd.d/client # ll total 16K drwxr-xr-x 2 bareos bareos 4.0K May 15 09:09 ./ drwxr-xr-x 5 bareos bareos 4.0K May 14 16:12 ../ -rw-r----- 1 bareos bareos 64 May 15 09:08 hostname.conf -rw-rw---- 1 bareos bareos 85 May 14 16:12 myself.conf

root@server:/etc/bareos/bareos-fd.d/client # bareos-fd -t 15-May 09:11 bareos-fd: Fatal Error at filed.c:371 because: Only one Client resource permitted in /etc/bareos/bareos-fd.d//.conf 15-May 09:11 hostname: ERROR in filed.c:251 Please correct configuration file: /etc/bareos/bareos-fd.d//.conf

project0 commented 6 years ago

I did a quick look into the debian package sources of bareos. Seems they just install default config files (f they dont exists), wheter the service is already configured or not. I guess it can happen that the setup will screw up the whole current configuration. In my opinion this is a problem of the way how bareos deploy default configs.

Anyway, i think we can set the default file name to myself.conf, the resulting config should not be affected of this change.

@amorphina did you observed problems of other bareos packages as well on upgrade?

project0 commented 6 years ago

This problem might affects director::director and storage::storage as well.

amorphina commented 6 years ago

I have upgraded ~60 clients + the director + the storage node, the only issues were with the filedaemon packages on all clients, director and storage. The other packages installed with no issues.

I know that it is not the best handling from BareOS team for the installation of default configs, regardless if they are present or not but it is much easyer to communicate with someone who worked in the same environment as I do ;), Maybe we will also submit a bugreport to the guys at BareOS.

project0 commented 6 years ago

Probably you can open a bug report at bareos. I found this old bug related to the issue: https://bugs.bareos.org/view.php?id=738

amorphina commented 6 years ago

Hi,

I opened a bug with them: https://bugs.bareos.org/view.php?id=948

Thanks!

Kind Regards, Atanas