Praise be to Allah.
Attention must be paid to the intention of the one who gave it as a waqf and the conditions he stipulated. It is not permissible to dispose of a waqf in a manner different to what was intended by the donor or what he stipulated, except in cases where doing so is necessary.
An example of what is necessary is when the waqf is unused and no one is benefitting from it. In that case, it may be moved to the closest thing to what the original donor intended.
Since the donor of this cooler gave it as a waqf to the mosque, and it is not possible to use it in that particular mosque, it may be moved to another mosque where it will be made use of.
If there is no mosque that needs it, then it may be moved to any place where people gather, such as a military barracks and so on.
Based on that, it should not be moved to the military barracks unless there is no mosque that needs it.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked: Is it permissible to move a waqf that was given to the mosque, such as a cupboard, if it is too big for the mosque and the mosque has no need of it?
He replied: Yes, it is permissible to move the waqf if that serves a greater purpose. If something is not needed in the mosque – such as a carpet, cupboard or anything else – we may move it to another mosque, if possible. If that is not possible, we can sell these things and spend their price on the mosque. But if it belongs to the Ministry of Awqaaf, then they should dispose of it in the way that is most appropriate. End quote. "Liqa’aat al-Baab al-Maftooh (168)".
With regard to selling it, that is not permissible so long as it is possible for it to be used in another place, because the donor intended to benefit people by supplying this cold water, so this aim should be taken into consideration.
And Allah knows best.