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

share|improve this question
up vote 3 down vote accepted

Yes using actions https://jujucharms.com/docs/1.20/actions

Actions 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.

share|improve this answer

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.

share|improve this answer
    
I suspect the hook environment will not be available then? relation-get and things like that? – Galgalesh Mar 26 '15 at 9:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.