TT#38200 Add support for virtual LI distributed role

This adds an additional virtual li_dist role on top of the existing li
role. The difference is that li is the cluster simpli acting in central
mode, while li_dist is the cluster acting in distributed mode.

Change-Id: I930c93380a0e88649c325b7faf3c0fb86d78e5ff
changes/38/21938/13
Guillem Jover 8 years ago
parent 8fc290600a
commit ae25a37bad

@ -25,8 +25,25 @@ sub has_role
$hostname = 'self';
}
# The LI role has a virtual role counterpart, which is active only in
# distributed mode.
if ('li_dist' =~ m/^$role$/) {
if ($self->{config}{cluster_sets}{type} eq 'distributed') {
$role = 'li';
} else {
return 0;
}
}
if (any { m/^$role$/ } @{$self->{config}{hosts}{$hostname}{role}}) {
return 1;
# The LI roles are a bit special, they use additional keys to get
# enabled, so we handle them here.
if ('li' =~ m/^$role$/) {
return $self->{config}{intercept}{enable} eq 'yes';
} else {
# Otherwise, unconditionally enable the role.
return 1;
}
}
return 0;

Loading…
Cancel
Save