Rabbi Avraham Shapira, the dean of Jerusalem’s Mercaz HaRav Kook Yeshiva and a former Ashkenazi Chief Rabbi has called on his student, IDF Chief Rabbi Brigadier-General Yisrael Weiss to resign from the IDF.From Ynet:
“IDF rabbis are also bound by Jewish law,” said Rabbi Shapira, and hinted that Weiss could “cleanse himself in an instant” by returning to civilian life.Rabbi Weiss is now in a once-in-a-lifetime situation where he can sanctify G-d's name by listening to his rabbi and resign, in spite of the personal price he will pay. Let's see if he is up to it.
Shapira added his opinion that the Jewish law forbidding giving parts of the land of Israel to non-Jews applied to civilians as well as soldiers.
“Expulsion of Jews is halachically (Jewish law) forbidden.”
Update: Rabbi Shapira's own words.