Definition of close ranks:
(v) :
(figuratively) To regroup forces, especially when this involves overlooking differences in order to face a challenge or adverse situation. Often implies making a show of unity, especially to the public.
(v) :
(figuratively) To maintain silence and secrecy in the face of some external threat.
(v) :
(military) To close the spacing between lines (ranks) of troops, as they are deployed across a battlefield, thereby decreasing the depth of the formation as it faces the enemy side.