With the intentional branch separation regarding the target stack,
interchanging said stacks basically amounts to undefined behaviour
(may sometimes appear working fine, until it won't, to the potential
disappointment of the users).
Sketch of possible solution:
1. pacemaker related parts
1a. check whether "pacemakerd" is present on the root-user-like
$PATH, bail out if not
1b. run pacemakerd --version and parse the first line
(e.g. Pacemaker 2.0.0-0.1.rc5.fc29), when pacemaker 2+ detected,
2. corosync related parts
2a. probably only parsing "corosync -v" is what's needed(?)
The earlier ahead-of-time warning, the better, both in respect to the
pcs usage flow (should be checked as early as with "pcs cluster auth"?)
and regarding the range of possible combinations -- would suggest to
have this combinatoric sanity established as early as in 7.6 if possible.
Note that using a new, systemic shell pipelining approach [bug 1359057]
would alleviate the need to perform redundant target checks like these
within the single compound command.