Skip to content

Feature Request: Introduce Ansible Variable for Java System Property java.io.tmpdir #2081

@1123

Description

@1123

Describe the issue
When the /tmp directory is mounted with the no_exec flag, the zstd-jni library placed in that directory during Kafka startup cannot be executed.

To make the library executable, the java.io.tmpdir System property must be changed. With CP-Ansible this can currently be done by overriding the KAFKA_OPTS environment variable.

Yet there is no dedicated variable for the java.io.tmpdir property, hence overriding KAFKA_OPTS may have side effects, since other important flags may be included in this variable.

To Reproduce

Install Kafka on a system that has mounted the tmp directory with the no_exec flag. Inspect the logs to see that the system cannot load the zstd-jni share object file from the /tmp directory. Include the -D java.io.tmpdir=/data/tmp option and start the broker. The error message is gone.

Expected behaviour
We would set an ansible variable named cp-ansible-java-io-tmpdir to /data/tmp, which is mounted without the no-exec flag. Then the java process would be started with the correct java.io.tmpdir system property.

Inventory File
This should be reproducible with all inventory files that include at least a single Kafka broker.

Logs
CP-Ansible runs through fine, but the broker logs show errors.

Environment (please complete the following information):

  • OS: RHEL 9
  • CP-Ansible Branch: 7.9.1-post
  • Ansible Version: 7.9.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions