In my time in Germany (early 70s) it was not even discussed: Being gay was considered a security risk and had you out (many used this argument to avoid our obligatory mil service).
Later, because so many made use of this to avoid consription, in the late 70s it was decided that you could serve as gay (*obliged to state so* if you were) but could not become officer or instructor.
In 1999 this changed, after a regional administrative court ruled that the prohibition to have a guy that had been outed by the MAD to be gay become professional (at that time it was obligatory to say you were gay, the idea behind it being that the Army could then better assess security risks) was violating constitution.
In 2000 then it was decided that homosexuals could serve in any position in the Armed Forces, and it became an obligation for superiors to "energically" make front against any kind of sexual discrimination, this also under the aspect that women were allowed into fighting formations at that time ("Führungshilfe für Vorgesetzte", Bd.2.,A,III,7).
Since 2004 now *all* forms of interpersonal relations are officially "considered absolutely and exlusively private matters", which also skipped the prohibition of "fraternisation", i.e. ranks relating with officers (
ZDv 14/3 Anlage B 173 , translation by me):
Dealing with Sexuality in the Armed Forces
I. Principle
The private shpere of soldiers as part of their personal rights is beyond any influence of command. Anything relating to sexuality is only relevant for the employment relationship if it affects operability, the comradely cohesion is impaired or in any other way leads to sustainable disruption of the service order.
I have not heard of any problems from my serving colleagues, heterosexual sexual assaults on service women seems to be the way bigger problem.
FWIW,
Rattler