Skip to content

Commit

Permalink
Merge pull request #103 from VariableDeclared/lma-improvements/graylo…
Browse files Browse the repository at this point in the history
…g-tls

Fix filebeat rendering issues
  • Loading branch information
esunar authored Jan 13, 2023
2 parents 4e3a715 + 0493a57 commit f5aef92
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ parts:
charm:
source: ./
plugin: reactive
build-snaps: [ charm ]
build-snaps:
# if it is build with charm/3.x it cannot be installed on bionic
# Error: pip requires Python '>=3.7' but the running Python is 3.6.9
- charm/2.x/stable

bases:
- build-on:
Expand Down
10 changes: 6 additions & 4 deletions reactive/filebeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
hook,
is_state,
when,
when_any,
when_not,
set_state,
remove_state
Expand Down Expand Up @@ -51,9 +52,11 @@ def blocked_until_reinstall():
status.blocked(msg)


@when('beat.render')
@when('apt.installed.filebeat')
@when('certificates.available')
@when_any(
'beat.render',
'apt.installed.filebeat',
'certificates.available'
)
@restart_on_change({
LOGSTASH_SSL_CERT: ['filebeat'],
LOGSTASH_SSL_KEY: ['filebeat'],
Expand Down Expand Up @@ -88,7 +91,6 @@ def render_filebeat_template():
# Ensure ssl files match config each time we render a new template
manage_filebeat_logstash_ssl()
remove_state('beat.render')

if connections:
if cfg_original_hash != cfg_new_hash:
service('restart', 'filebeat')
Expand Down

0 comments on commit f5aef92

Please sign in to comment.