I know you can debug hooks in error state by running juju debug-hooks nodemane
and then running juju resolved --retry nodename
. Is it possible to run or rerun hooks that are not in an error state?
Thanks
I know you can debug hooks in error state by running juju debug-hooks nodemane
and then running juju resolved --retry nodename
. Is it possible to run or rerun hooks that are not in an error state?
Thanks
Yes using
actions
https://jujucharms.com/docs/1.20/actionsActions are exposed as of Juju 1.23. In Juju 1.22, they are only enabled in the CLI when JUJU_DEV_FEATURE_FLAG=actions is set.
If you don't need the hooks to execute in a 'hook environment' then you can just execute them via ssh as a normal script.
An alternative way is to use 'juju run'.
juju run --unit someunit/1 'hooks/some-hook'
When using 'juju run' for a unit or all units of a service, the working directory is set to the charm, so you can access the hooks directly.