Discussion:
[Fab-user] First root@host, then user@host ...
Thomas Güttler
2013-10-10 08:17:17 UTC
Permalink
Hi,

I found several ways to solve this:

first connect as ***@host (for example: create user "user").

Then connect as ***@host.

This should be done in one task.

Please tell me the simplest or best way to do this.

Thank you.
Jens Rantil
2013-10-11 21:26:27 UTC
Permalink
Hi Thomas,

I would probably have one task that make two calls to `execute`[1], one for
the root user execution, and one for the user user execution.

[1]
http://docs.fabfile.org/en/1.8/api/core/tasks.html?highlight=execute#fabric.tasks.execute

Here's a small example: https://gist.github.com/JensRantil/6942269 I
haven't executed it, but it should be "fairly" runnable ;) Possibly, you
might have to specify a host for executing the `supertask` with.

Cheers,
Jens
Post by Thomas Güttler
Hi,
This should be done in one task.
Please tell me the simplest or best way to do this.
Thank you.
______________________________**_________________
Fab-user mailing list
https://lists.nongnu.org/**mailman/listinfo/fab-user<https://lists.nongnu.org/mailman/listinfo/fab-user>
Thomas Güttler
2013-10-14 08:02:44 UTC
Permalink
Hi,

I created a decorator to solve this:

https://gist.github.com/guettli/6972365

The user name must not be in the source code, since it can be different.

Works fine.
Post by Jens Rantil
Hi Thomas,
I would probably have one task that make two calls to `execute`[1], one for the root user execution, and one for the
user user execution.
[1] http://docs.fabfile.org/en/1.8/api/core/tasks.html?highlight=execute#fabric.tasks.execute
Here's a small example: https://gist.github.com/JensRantil/6942269 I haven't executed it, but it should be "fairly"
runnable ;) Possibly, you might have to specify a host for executing the `supertask` with.
Cheers,
Jens
Hi,
This should be done in one task.
Please tell me the simplest or best way to do this.
Thank you.
_________________________________________________
Fab-user mailing list
https://lists.nongnu.org/__mailman/listinfo/fab-user <https://lists.nongnu.org/mailman/listinfo/fab-user>
Loading...