Skip to content

Commit

Permalink
Reload daemons for Logstash restart (#347)
Browse files Browse the repository at this point in the history
Reload unit files when restart Logstash via handler. We're running the
handler for upgrades of the package, not only when changing
configuration.

This might make reloads a bit slower but it seems to be the only chance
to deal with changes in the Logstash unit file. We're not managing this
file with the collection, so changing it manually is fine.

If someone does, we need to reload the unit file.

We *could* introduce a separate handler. One for upgrades of the package
that does the daemon reload and another without reload for regular
configuration changes. @frankhetterich @afeefghannam89 @martialblog what
do you think? I went for one handler which does it all but that's just a
suggestion so far.

Thank you, @frankhetterich for the bug report and the suggested fix.

fixes #342
  • Loading branch information
widhalmt authored Oct 23, 2024
1 parent 15ad2ea commit 65dfa4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roles/logstash/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ansible.builtin.service:
name: logstash
state: restarted
daemon-reload: true
when:
- logstash_enable | bool
- not logstash_freshstart.changed | bool
Expand All @@ -12,4 +13,5 @@
ansible.builtin.service:
name: logstash
state: restarted
daemon-reload: true
when: not logstash_config_autoreload and logstash_enable | bool

0 comments on commit 65dfa4f

Please sign in to comment.