Where does juju store the configuration files for services it deploys?

For example when I deploy vault, where is the config file?
The same question for all of the other services, is it in /home/ubuntu/snap/serviceName/???
I’m trying to find vault’s config file but knowing where to find the config files for other services will be immensely helpful for troubleshooting and diagnosing other issues moving forward.

Hey @nathan-flowers it all depends on the installation artifact deployed with juju. Juju doesn’t normally decide where configs are placed. Juju rather just manages them (renders the configs) using whatever means native to the software.

For example, if snaps are installed, then configs are usually under /snap/… whereas debs are under wherever /etc /usr etc.

You can try to inspect the code to see which mechanism is used for your specific charm.

Juju stores all state information for the charmed deployment within the mongodb database installed on the controller(s) you have bootstrapped.

The juju agent code such as config-get, config-set, as well as the juju client code such as juju config , juju status, juju export-bundle, etc call to the juju API on port 17070 of the controller(s) to query the information in real time from the database.

If you are indeed asking about configuration files, it will be /var/snap/$snapname/(current|common)/ and if not snapped, it will be the default path for the configuration files as defined by the debian packaging. You can try querying this from /var/lib/dpkg/info/$packagename.list but some config files will not show up in the list.

Typically configuration files managed by charms will have a template version of the config file in /var/lib/juju/agents/unit-${app-name}-${unit-number}/charm/templates/. You could potentially use strings from these files to search for the active config-file on-unit. There may also be logs referring to rendering or updating these config files within the logs in /var/log/juju/unit-${app-name}-${unit-number}.log

Hope this helps.
-Drew

1 Like