Hello Community,

I'd be interested to hear the consensus of solving the following problem
(this is kind of related to another question I've asked recently but
expanded a little and with a clearer use case). I'm targeting the 1.25
command line but from what I can see the question stands in 2.0 as well.

Let's say my workload includes some scripts for running various tasks on
the unit, like upgrading, or backups, I include these as bash scripts with
my charm. Let's say that calling these scripts isn't done by me at the
command line, but within another script I have (in the case of backup this
script might trigger the backup to run across all of my units and then
verify those backups).

In this case I'd like to be able to run that script across all units and
know when it's done. So I'd use:

juju run --service myapp 'backup"

However, having scripts in my charm feels like it fits the actions
abstraction quite nicely, I will probably decide to add these scripts to my
charm as actions so that users can see what scripts are available. However
the command line doesn't allow me to run actions across all units, neither
does it allow me to block until it's all done. These leaves me in the
rather odd situation where my master script looks like this:

juju run --service myapp 'actions/backup"

So my question is.
What should be done here?
a) juju action do have flags to support sending the command to all units
and block until the action has been run
b) juju run is exactly what I should be using for this use case
c) Is there some other solution that I've not considered?

Thanks for your time

Matty
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju

Reply via email to