python - Can I make a juju action pass a file back to where it was called from? - Ask Ubuntu


the docs describe "snapshot" action, backs database. have used similar wondering, once snapshot create file (in case postgresql dump) sits there on machine particular charm. there not way of passing machine run "juju run-action ..." command in first place? (i'm not sure of terminology here, i'm going call "host")

i'm using python, , know can use hookenv.action_set({}) pass message back, whole file? suppose use pass contents of file back, seems bit hacky.

if use like: host_ip, _, machine_ip, __ = os.environ['ssh_connection'].split(' ') , try scp file using host_ip information, wants password, isn't automated.

does have suggestions doing within action please?

you send shh private key in charm action,

$ juju run-action ssh_pkey=`cat .ssh/somekey` 

and add public key host authorized_keys.

or set host key in charm config

$ juju config myservice key=`cat .ssh/somekey` 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User