I have the following Fabric task:
def ssh_keygen(user, dir):
env.user = user
run("ssh-keygen %s" % dir)
I want to call it using "execute" but need to pass the task an argument. i.e. user and dir
execute(ssh_keygen('jbloggs', '/home/jbloggs'), hosts=["server1"])
However this does not work:
No hosts found. Please specify (single) host string for connection: Traceback (most recent
Is there anyway to achieve this?
execute(ssh_keygen, 'jbloggs', '/home/jbloggs', host="server1")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With