Created
August 24, 2024 17:16
-
-
Save ferki/2cad6a0c40681da6c2fb135d04e82a44 to your computer and use it in GitHub Desktop.
Minimal Rex sudo example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Rex -feature => [ '1.4', 'exec_autodie' ]; | |
sudo_password 'sudo password'; | |
task test => sub { | |
say run 'whoami'; # should be normal user | |
sudo TRUE; | |
say run 'whoami'; # should be root | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment