Is it possible to read OS environment variables in standalone.xml/domain.xml/host.xml of JBoss EAP 6?

Solution Verified - Updated -

Issue

Is it possible to read OS environment variables in EAP 6 configuration files standalone.xml, domain.xml and host.xml?

For example, I would like to read OS environment variable HOSTNAME and set it to the following inet-address:

<interfaces>
    <interface name="management">
        <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
    </interface>
    <interface name="public">
        <inet-address value="${jboss.bind.address:127.0.0.1}"/>
    </interface>
    <interface name="unsecure">
        <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
    </interface>
</interfaces>

I understand I can set OS environment variables via the java system properties in command line like:

./standalone.sh -b $HOSTNAME -bmanagement $HOSTNAME

But I would like to achieve this without specifying OS environment variables via command line.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.