thomasvandoren / puppet-etckeeper

Not actively developed - Puppet module for etckeeper.
https://forge.puppetlabs.com/thomasvandoren/etckeeper
BSD 2-Clause "Simplified" License
14 stars 15 forks source link

[Bug] Requiring conf file for package breaks Debian install #7

Closed NITEMAN closed 11 years ago

NITEMAN commented 11 years ago

Module is unusable on Debian since Dpkg complaints about configuration files already exists on the system:

err: /Stage[main]/Etckeeper/Package[etckeeper]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install etckeeper' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  etckeeper
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 32.5 kB of archives.
After this operation, 389 kB of additional disk space will be used.
Get:1 http://ftp.es.debian.org/debian/ squeeze/main etckeeper all 0.48 [32.5 kB]
Preconfiguring packages ...
Fetched 32.5 kB in 0s (102 kB/s)
Selecting previously deselected package etckeeper.
(Reading database ... 41022 files and directories currently installed.)
Unpacking etckeeper (from .../etckeeper_0.48_all.deb) ...
Processing triggers for man-db ...
Setting up etckeeper (0.48) ...

Configuration file `/etc/etckeeper/etckeeper.conf'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
 ==> Using current old file as you requested.
: not foundper/etckeeper.conf: 6:
dpkg: error processing etckeeper (--configure):
 subprocess installed post-installation script returned error exit status 127
configured to not write apport reports
Processing triggers for python-central ...
Errors were encountered while processing:
 etckeeper
E: Sub-process /usr/bin/dpkg returned an error code (1)

notice: /Stage[main]/Etckeeper/Exec[etckeeper-init]: Dependency Package[etckeeper] has failures: true
warning: /Stage[main]/Etckeeper/Exec[etckeeper-init]: Skipping because of failed dependencies~
thomasvandoren commented 11 years ago

Thanks for the pull request!

It seems like the --force-confold flag that puppet is passing into the dpkg call is doing the right thing and using the file created by the module. I believe something in the postinst script is failing (specifically when it calls postinst configure), based on the log line about post-installation script returning a 127 exit status.

It looks like the version available in the squeeze repo is 0.48 and the one available on Ubuntu is a bit newer at 0.6x. I wonder if the /etc/etckeeper/etckeeper.conf file generated by this module is not compatible with older version?

I'll take a look later this week on a debian vm. If you have a chance to install etckeeper 0.48 with its default etckeeper.conf file, would you mind posting it here?

I appreciate the effort you made to make this change, but I can't merge it. The etckeeper.conf file needs to exist prior to the package installation. Otherwise the postinst script will try to initialize a bazaar repo, which will fail (unless bazaar happens to be installed). See line 81 of the postinst script for the etckeeper init call.

Thanks!

NITEMAN commented 11 years ago

Thanks for your response.

It seems that the error was caused either by an outdated puppet install (Debian default version) or most likely due a line ending conversion problem (risks of using tortoise git & windows).

I can't reproduce the issue any more, excuse me for the inconveniences.

Best regards