Juju environment variables

Juju client

These variables are available on the Juju client in order to change its default behaviour.

GOCOOKIES

The default location of the Go cookies file is ~/.go-cookies. This variable can change that.

Example:

GOCOOKIES=/var/lib/landscape/juju-homes/1/.go-cookies

JUJU_DATA

This sets the path where Juju will look for its configuration files. You do not need to set this - by default Juju follows XDG guidelines and on Linux systems it will use the path:

~/.local/share/juju

JUJU_HOME (Deprecated)

For versions of Juju prior to 2.0, this variable indicated the 'home' directory where Juju kept configuration and other data.

JUJU_HOME=~/.juju

JUJU_REPOSITORY (Deprecated)

For versions prior to 2.0, this variable set a local charms directory that Juju would search when deploying an application. The equivalent --repository=/path/to/charms switch (with juju deploy) was also available.

Both the environment variable and the switch are no longer functional in 2.x versions.

JUJU_LOGGING_CONFIG

This setting takes effect on an environment only at bootstrap time. In stable Juju releases, agents are started with logging set to WARNING, and units are set to INFO. Development releases are set to DEBUG globally. Post bootstrap, on a running environment you can change the logging options to be more or less verbose. For example:

juju model-config logging-config="juju=DEBUG; unit=WARNING"

JUJU_MODEL

Used to specify the current Juju model to use. This is overridden if the model is specified on the commandline using -m MODEL.

JUJU_DEV_FEATURE_FLAGS

This setting takes effect on an environment only at bootstrap time. Unstable or pre-release features are enabled only when the feature flag is enabled prior to bootstrapping the environment.

JUJU_DEV_FEATURE_FLAGS=<flag1,flag2> juju bootstrap

Warning: Unforeseen and detrimental results can occur by enabling developmental features. Do not do so on production systems.

JUJU_STARTUP_LOGGING_CONFIG

This setting takes effect on an environment only at bootstrap time, and is used to set the verbosity of the bootstrap process. For example, to troubleshoot a failure bootstrapping during provider development, you can set the log level to TRACE.

JUJU_STARTUP_LOGGING_CONFIG=TRACE juju bootstrap

JUJU_CLI_VERSION

This allows you to change the behaviour of the command line interface (CLI) between major Juju releases and exists as a compatibility flag for those users wishing to enable the newer behaviour of the Juju CLI. As the CLI output and behaviour is stable between minor releases of Juju, setting JUJU_CLI_VERSION will enable developers and users to preview the newer behaviour of the CLI.

export JUJU_CLI_VERSION=2
juju status

Building

These variables are available to the charm build process.

LAYER_PATH

Sets the location to search for charm-layers. If no layer is found in this location, it defaults to searching the directory at interfaces.juju.solutions for the requested charm-layer.

LAYER_PATH=$JUJU_REPOSITORY/layers

INTERFACE_PATH

Sets the location to search for interface-layers. If no interface is found in this location, it defaults to searching the directory at interfaces.juju.solutions for the requested interface-layer.

INTERFACE_PATH=$JUJU_REPOSITORY/interfaces

Unit

These variables are available to charms during hook execution.

JUJU_ACTION_NAME

The name of the currently executing action

JUJU_ACTION_NAME=backup

JUJU_ACTION_TAG

A concatenation of JUJU_ACTION_UUID and the word 'action'.

JUJU_ACTION_TAG=action-97db750c-c7d7-47a4-8b57-9cc3e85f8153

JUJU_ACTION_UUID

The current UUID of the executing action.

JUJU_ACTION_UUID=97db750c-c7d7-47a4-8b57-9cc3e85f8153

JUJU_API_ADDRESSES

A space-separated list of API servers.

JUJU_API_ADDRESSES=10.10.10.1:17070

JUJU_AGENT_SOCKET

The socket that the unit agent uses to communicate with individual Units.

JUJU_AGENT_SOCKET=@/var/lib/juju/agents/unit-postgresql-0/agent.socket

JUJU_AVAILABILITY_ZONE

The availability zone for the unit being executed.

JUJU_CHARM_DIR

The path to the currently executing charm directory.

JUJU_CHARM_DIR=/var/lib/juju/agents/unit-postgresql-0/charm

JUJU_CONTEXT_ID

Used by Juju to communicate to ask a running agent to execute a command on Juju's behalf.

JUJU_CONTEXT_ID=postgresql/0:db-relation-joined:34317605475203611

JUJU_DEBUG

The temporary directory where juju debug-hooks is spawned from.

JUJU_DEBUG=/tmp/tmp.vGQlc2bTcV

JUJU_MODEL_NAME

The human-friendly name of the current model.

JUJU_MODEL_NAME=default

JUJU_MODEL_UUID

The unique identifier of the juju model.

JUJU_MODEL_UUID=2c0896ce-fd6c-4647-8540-26f848e061f9

JUJU_HOOK_NAME

The name of the hook being executed.

JUJU_HOOK_NAME=db-relation-joined

JUJU_MACHINE_ID

The ID of the machine that's currently executing the hook.

JUJU_MACHINE_ID=1

JUJU_RELATION

The relation name being executed.

JUJU_RELATION=db

JUJU_RELATION_ID

The ID of the relation being executed.

JUJU_RELATION_ID=db:20

JUJU_REMOTE_UNIT

The name of the current related unit.

JUJU_REMOTE_UNIT=reddit/0

JUJU_UNIT_NAME

The name of the local unit being executed.

JUJU_UNIT_NAME=vanilla/0

JUJU_VERSION

The version of the Juju unit agent.

JUJU_VERSION=2.4.1

Internal Use only

These exist for developmental purposes only.

JUJU_DUMMY_DELAY

JUJU_NOTEST_MONGOJS