I tried creating multiple roles for the same server with different
users, but this gets into trouble with tasks that apply to all roles
executing twice.
Thanks!
Jaime
Is closing existing connections the best way to connect to a host as a
different user, and if so, what's the best way to do that?
role :foo, "jo...@somehost.com"
role :bar, "bi...@somehost.com"
task :first_task, :roles => :foo do
# ...
end
task :second_task, :roles => :bar do
# ...
end
Note, though, that all hosts, regardless of username, must use the
same password. That, or you must be using public keys (which is the
recommended approach).
- Jamis
Thanks,
Paul
On Sep 19, 10:48 am, "Jamis Buck" <ja...@37signals.com> wrote:
> Just define the server multiple times withdifferentusernames, and
> then classify each task with the appropriate role:
>
> role :foo, "j...@somehost.com"
> role :bar, "b...@somehost.com"
>
> task :first_task, :roles => :foo do
> # ...
> end
>
> task :second_task, :roles => :bar do
> # ...
> end
>
> Note, though, that all hosts, regardless of username, must use the
> same password. That, or you must be using public keys (which is the
> recommended approach).
>
> - Jamis
>
> On 9/19/07, ky <goo...@boxy.endjunk.com> wrote:
>
>
>
> > I have the same question; would like to bump this to the top again.
>
> > Is closing existing connections the best way to connect to a host as a
> >differentuser, and if so, what's the best way to do that?
Incidentally, the reason I need this in the first place is because
while using your (awesome) EC2 image, your default setup is not to
allow sudo, so I wanted to log in sometimes as root and sometimes as
app!
Thanks again,
Jaime