File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Revision history for Rex
1212 - Fix parsing FreeBSD memory details
1313 - Recognize laundry memory on FreeBSD
1414 - Fix command existence checks without which
15+ - Fix hostgroup membership list
1516
1617 [DOCUMENTATION]
1718
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use attributes;
1515use Rex::Group::Entry::Server;
1616
1717use vars qw( %groups) ;
18- use List::Util 1.45 qw( uniq) ;
18+ use List::Util 1.45 qw( any uniq) ;
1919use Data::Dumper;
2020
2121sub new {
@@ -24,8 +24,16 @@ sub new {
2424 my $self = {@_ };
2525
2626 bless ( $self , $proto );
27+
2728 for my $srv ( @{ $self -> {servers } } ) {
2829 $srv -> append_to_group( $self -> {name } );
30+
31+ for my $group ( keys %groups ) {
32+
33+ if ( any { $_ eq $srv } $groups {$group }-> get_servers ) {
34+ $srv -> append_to_group($group );
35+ }
36+ }
2937 }
3038
3139 return $self ;
You can’t perform that action at this time.
0 commit comments