Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Revision history for Rex
[BUG FIXES]
- Fix warning about redundant arguments when using sync with key
authentication
- Fix setting distributor when versioned feature flags are active

[DOCUMENTATION]
- Clarify sudo usage for multiple commands
Expand All @@ -17,6 +18,8 @@ Revision history for Rex
[MINOR]

[NEW FEATURES]
- Add new configuration option to control attaching default authentication
info to tasks

[REVISION]

Expand Down
2 changes: 1 addition & 1 deletion lib/Rex.pm
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ sub import {
# remove default task auth
if ( $add =~ m/^\d+\.\d+$/ && $add >= 0.31 ) {
Rex::Logger::debug("activating featureset >= 0.31");
Rex::TaskList->create()->set_default_auth(0);
Rex::Config->set_default_auth(0);
$found_feature = 1;
}

Expand Down
22 changes: 22 additions & 0 deletions lib/Rex/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ our (
$use_template_ng, $use_rex_kvm_agent,
$autodie, $task_chaining_cmdline_args,
$waitpid_blocking_sleep_time, $write_utf8_files,
$default_auth,
);

# some defaults
Expand Down Expand Up @@ -1591,6 +1592,27 @@ sub get_write_utf8_files {
return $write_utf8_files;
}

=head2 set_default_auth

=head2 get_default_auth

Sets and gets the value of the C<$default_auth> configuration variable.

This controls whether Rex should attach default authentication info to tasks.

Default is C<1>.

=cut

sub set_default_auth {
my $self = shift;
$default_auth = shift;
}

sub get_default_auth {
return $default_auth // 1;
}

=head2 register_set_handler($handler_name, $code)

Register a handler that gets called by I<set>.
Expand Down
2 changes: 1 addition & 1 deletion lib/Rex/TaskList/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sub new {
bless( $self, $proto );

$self->{IN_TRANSACTION} = 0;
$self->{DEFAULT_AUTH} = 1;
$self->{DEFAULT_AUTH} = Rex::Config->get_default_auth();
$self->{tasks} = {};

return $self;
Expand Down
1 change: 1 addition & 0 deletions t/group.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use warnings;
use Test::More tests => 95;

use Rex -feature => '0.31';
use Rex::Group;

delete $ENV{REX_USER};

Expand Down