Secret::Store - A module to interact with secret stores
This file contains 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 strict; | |
use warnings; | |
use Rex -feature => [ '1.4', 'exec_autodie' ]; | |
use Data::Printer; | |
BEGIN { | |
use Rex::Shared::Var; | |
share qw(%results_for); | |
} |
Thanks to GitHub Sponsors, Rex::Hook::File::Impostor has already been published \o/
This file contains 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; | |
use Secret::Store; | |
my $store = Secret::Store->new( backend => 'pass' ); | |
sudo_password $store->get('sudo/username'); | |
task 'whoami' => sub { | |
sudo TRUE; | |
say run 'whoami'; |
This file contains 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; | |
use Rex::Hook::File::Diff; | |
task 'diff_example', sub { | |
file '/tmp/diff.example', | |
content => gmtime(); | |
}; |
This file contains 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 => [qw(1.4 exec_autodie)]; | |
use Rex::Commands::SimpleCheck; | |
sayformat "[%h]>\t%s"; | |
task 'reboot', sub { | |
my $server = connection->server; | |
my $port = Rex::Config->get_port( server => $server ) || 22; |
This file contains 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 v5.24; # for postfix dereferencing below | |
use strict; | |
use warnings; | |
use Rex -feature => [ '1.4', 'exec_autodie' ]; | |
use Rex::CMDB; | |
use File::Spec; | |
use YAML qw(LoadFile); |
This file contains 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 5.012; | |
use warnings; | |
use Rex -feature => [ '1.4', 'exec_autodie' ]; | |
BEGIN { | |
use Rex::Shared::Var; | |
share qw($should_restart @services_to_restart); | |
} |
This file contains 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 5.26; | |
use Rex; | |
task 'heredoc_run', sub { | |
run 'foo', command => <<~'EOF', | |
f=$(cat /tmp/num) | |
if [ "$f" == 2 ]; then | |
ls -l / >/tmp/foo.txt | |
else | |
ls -l / >/tmp/bar.txt |
This file contains 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
diff --git a/lib/Rex/Interface/Connection/OpenSSH.pm b/lib/Rex/Interface/Connection/OpenSSH.pm | |
index 33f01263..6ecbc462 100644 | |
--- a/lib/Rex/Interface/Connection/OpenSSH.pm | |
+++ b/lib/Rex/Interface/Connection/OpenSSH.pm | |
@@ -53,28 +53,16 @@ sub connect { | |
$self->{__auth_info__} = \%option; | |
Rex::Logger::debug("Using Net::OpenSSH for connection"); | |
- Rex::Logger::debug( "Using user: " . $user ); | |
- Rex::Logger::debug( Rex::Logger::masq( "Using password: %s", $pass ) ) |