Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu Jammy support. #96

Merged
merged 2 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ To monitor additional applications, simply relate the filebeat subordinate:

juju add-relation filebeat:beats-host my-charm

## Build and publish new versions

This charm uses the reactive framework. `charm pack` is used to build a
deployable charm. In order to publish new versions of the charm, the following
commands need to be run:

**Note:** Use appropriate revision number in `charmcraft release` command.

```
charmcraft pack
charmcraft upload filebeat_ubuntu-22.04-amd64_ubuntu-20.04-amd64_ubuntu-18.04-amd64.charm
charmcraft release filebeat --revision=34 --channel=edge
charmcraft status filebeat
```

## Contact Information

- <elasticsearch-charmers@lists.launchpad.net>
Expand Down
32 changes: 32 additions & 0 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Learn more about charmcraft.yaml configuration at:
# https://juju.is/docs/sdk/charmcraft-config
# This is a template `charmcraft.yaml` file for reactive charms
# This file is managed by bootstack-charms-spec and should not be modified
# within individual charm repos. https://launchpad.net/bootstack-charms-spec

type: charm

parts:
charm:
source: ./
plugin: reactive
build-snaps: [ charm ]

bases:
- build-on:
- name: ubuntu
channel: "20.04"
architectures: ["amd64"]
run-on:
- name: ubuntu
channel: "22.04"
architectures:
- amd64
- name: ubuntu
channel: "20.04"
architectures:
- amd64
- name: ubuntu
channel: "18.04"
architectures:
- amd64
13 changes: 6 additions & 7 deletions reactive/filebeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from charms.reactive import remove_state
from charms.reactive import hook
from charms.reactive.helpers import data_changed
from charms.templating.jinja2 import render

from charmhelpers.core import unitdata
from charmhelpers.core.hookenv import config, log
Expand Down Expand Up @@ -108,13 +107,13 @@ def manage_filebeat_logstash_ssl():
key = base64.b64decode(logstash_ssl_key).decode('utf8')

if data_changed('logstash_cert', cert):
render(template='{{ data }}',
context={'data': cert},
target=LOGSTASH_SSL_CERT, perms=0o444)
with open(LOGSTASH_SSL_CERT, "w") as cert_file:
cert_file.write(cert)
os.chmod(LOGSTASH_SSL_CERT, 0o444)
if data_changed('logstash_key', key):
render(template='{{ data }}',
context={'data': key},
target=LOGSTASH_SSL_KEY, perms=0o400)
with open(LOGSTASH_SSL_KEY, "w") as key_file:
key_file.write(key)
os.chmod(LOGSTASH_SSL_KEY, 0o400)
else:
if not logstash_ssl_cert and os.path.exists(LOGSTASH_SSL_CERT):
os.remove(LOGSTASH_SSL_CERT)
Expand Down
6 changes: 6 additions & 0 deletions templates/filebeat-6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,9 @@ output:
{% if juju_principal_unit -%}
name: {{ juju_principal_unit }}
{%- endif %}
seccomp:
default_action: errno
syscalls:
- action: allow
names:
- clone3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we already supports filebeat 7, could you please check if this syscall is also needed for filebeat-7.yaml? You can test it by replacing the default value of install_sources config option with "deb https://artifacts.elastic.co/packages/7.x/apt stable main"

Copy link
Contributor Author

@mkalcok mkalcok Aug 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to mention this in the description but I forgot. Filebeat 7 has this problem fixed in 7.15.2 so I don't think we need to explicitly configure it.

1 change: 0 additions & 1 deletion wheelhouse.txt

This file was deleted.