We have made decision to use Dockerized elasticsearch instance. Therefore server cleanup should look like:
class { 'elasticsearch':
ensure => absent,
}
But actually deb package post installation script returns error code 8 therefore got next error:
Error: Execution of '/usr/bin/apt-get -y -q remove --purge elasticsearch' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
libtomcrypt0 libtommath0 timelimit
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
elasticsearch*
0 upgraded, 0 newly installed, 1 to remove and 29 not upgraded.
After this operation, 143 MB disk space will be freed.
(Reading database ... 97714 files and directories currently installed.)
Removing elasticsearch (6.3.0) ...
Stopping elasticsearch service... * Stopping Elasticsearch Server
...done.
OK
update-rc.d: /etc/init.d/elasticsearch exists during rc.d purge (use -f to force)
Deleting log directory... OK
Purging configuration files for elasticsearch (6.3.0) ...
userdel: user elasticsearch is currently used by process 53798
dpkg: error processing package elasticsearch (--purge):
subprocess installed post-removal script returned error exit status 8
Errors were encountered while processing:
elasticsearch
E: Sub-process /usr/bin/dpkg returned an error code (1)
Error: /Stage[main]/Elasticsearch::Package/Package[elasticsearch]/ensure: change from '6.3.0' to 'purged' failed: Execution of '/usr/bin/apt-get -y -q remove --purge elasticsearch' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
libtomcrypt0 libtommath0 timelimit
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
elasticsearch*
0 upgraded, 0 newly installed, 1 to remove and 29 not upgraded.
After this operation, 143 MB disk space will be freed.
(Reading database ... 97714 files and directories currently installed.)
Removing elasticsearch (6.3.0) ...
Stopping elasticsearch service... * Stopping Elasticsearch Server
...done.
OK
update-rc.d: /etc/init.d/elasticsearch exists during rc.d purge (use -f to force)
Deleting log directory... OK
Purging configuration files for elasticsearch (6.3.0) ...
userdel: user elasticsearch is currently used by process 53798
dpkg: error processing package elasticsearch (--purge):
subprocess installed post-removal script returned error exit status 8
Errors were encountered while processing:
elasticsearch
E: Sub-process /usr/bin/dpkg returned an error code (1)
Info: Class[Elasticsearch]: Unscheduling all events on Class[Elasticsearch]
Info: Stage[main]: Unscheduling all events on Stage[main]
Bug description
Unable to uninstall elasticsearch via puppet.
Steps to reproduce;
Install service (initial setup)
We have made decision to use Dockerized elasticsearch instance. Therefore server cleanup should look like:
But actually deb package post installation script returns error code 8 therefore got next error:
Try to fix (stop service):
But got this error which look like actual bug