krimdomu/Rex — Issue #17: Installing packages as sudo
Author: cybersiddhu
Created: 2012-03-03 14:50:08+00:00
State: open

How to write a task to do that. I tried something like this ...

```perl
use Rex::Commands::Pkg

user 'user';
private_key 'key';
public_key 'public';
key_auth;

desc 'install git';
task 'install-git', sub {
install package => 'git'
};
```

I am connecting with user who has sudo access. However, the above task invokes
```
yum -y install git
```
which obviously do not work without sudo.

Invoking ```run 'sudo yum -y install git'``` is an option, but i am tried to avoid os specific command if possible.