Skip to content

Commit

Permalink
Add pre and postun to clean the cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
manegron committed Oct 10, 2024
1 parent fce61f4 commit 270fa47
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions packaging/rpm/cookbook-logstash.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand All @@ -49,23 +58,26 @@ mkdir -p /share/logstash-rules
%doc

%changelog
* Fri Jan 19 2023 David Vanhoucke <[email protected]> - 2.0.1-1
* Thu Oct 10 2024 Miguel Negrón <[email protected]>
- Add pre and postun

* Fri Jan 19 2023 David Vanhoucke <[email protected]>
- Add apstate pipeline

* Fri Sep 22 2023 Miguel Negrón <[email protected]> - 2.0.0-1
* Fri Sep 22 2023 Miguel Negrón <[email protected]>
- Remove social

* Tue Apr 18 2023 Luis J. Blanco <[email protected]> - 1.0.21-1
* Tue Apr 18 2023 Luis J. Blanco <[email protected]>
- Monitor pipeline

* Wed Nov 17 2021 Javier Rodriguez <[email protected]> - 1.0.3-1
* Wed Nov 17 2021 Javier Rodriguez <[email protected]>
- Vault pipeline enrichment

* Fri Oct 22 2021 Javier Rodriguez <[email protected]> - 1.0.2-1
* Fri Oct 22 2021 Javier Rodriguez <[email protected]>
- Netflow pipeline enrichment

* Tue Oct 19 2021 Javier Rodriguez <[email protected]> - 1.0.1-1
* Tue Oct 19 2021 Javier Rodriguez <[email protected]>
- Sflow pipeline enrichment

* Thu Jan 25 2018 Juan J. Prieto <[email protected]> - 1.0.0-1
* Thu Jan 25 2018 Juan J. Prieto <[email protected]>
- first spec version

0 comments on commit 270fa47

Please sign in to comment.