I have two requests:
-
Add this to the hook tools reference page (probably why it’s little-known )
-
Add support to
juju-run
for the{unit}/leader
syntax that the external CLI supports (e.g.,juju-run foo/leader "leader-set hash=$hash"
). Sincejuju-run
can’t actually invoke something on another machine, presumably this would just turn into a no-op on non-leaders, but it would still be useful since the background service or whatever can’t actually tell if it’s running on the leader without a hook context. (Otherwise, the charm potentially has to add and remove services every time leadership changes, or I guess create a local cache of the leadership flag.)