From 270fa471d992946ce4e9a25a3139603905f9e0f9 Mon Sep 17 00:00:00 2001 From: manegron Date: Thu, 10 Oct 2024 22:19:26 +0100 Subject: [PATCH] Add pre and postun to clean the cookbook --- packaging/rpm/cookbook-logstash.spec | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/packaging/rpm/cookbook-logstash.spec b/packaging/rpm/cookbook-logstash.spec index 724e774..cff4f45 100644 --- a/packaging/rpm/cookbook-logstash.spec +++ b/packaging/rpm/cookbook-logstash.spec @@ -26,6 +26,9 @@ chmod -R 0755 %{buildroot}%{cookbook_path} install -D -m 0644 README.md %{buildroot}%{cookbook_path}/README.md %pre +if [ -d /var/chef/cookbooks/logstash ]; then + rm -rf /var/chef/cookbooks/logstash +fi %post case "$1" in @@ -40,6 +43,12 @@ case "$1" in esac mkdir -p /share/logstash-rules +%postun +# Deletes directory when uninstall the package +if [ "$1" = 0 ] && [ -d /var/chef/cookbooks/logstash ]; then + rm -rf /var/chef/cookbooks/logstash +fi + %files %defattr(0755,root,root) %{cookbook_path} @@ -49,23 +58,26 @@ mkdir -p /share/logstash-rules %doc %changelog -* Fri Jan 19 2023 David Vanhoucke - 2.0.1-1 +* Thu Oct 10 2024 Miguel Negrón +- Add pre and postun + +* Fri Jan 19 2023 David Vanhoucke - Add apstate pipeline -* Fri Sep 22 2023 Miguel Negrón - 2.0.0-1 +* Fri Sep 22 2023 Miguel Negrón - Remove social -* Tue Apr 18 2023 Luis J. Blanco - 1.0.21-1 +* Tue Apr 18 2023 Luis J. Blanco - Monitor pipeline -* Wed Nov 17 2021 Javier Rodriguez - 1.0.3-1 +* Wed Nov 17 2021 Javier Rodriguez - Vault pipeline enrichment -* Fri Oct 22 2021 Javier Rodriguez - 1.0.2-1 +* Fri Oct 22 2021 Javier Rodriguez - Netflow pipeline enrichment -* Tue Oct 19 2021 Javier Rodriguez - 1.0.1-1 +* Tue Oct 19 2021 Javier Rodriguez - Sflow pipeline enrichment -* Thu Jan 25 2018 Juan J. Prieto - 1.0.0-1 +* Thu Jan 25 2018 Juan J. Prieto - first spec version