Former energy secretary Grant Shapps was promoted to the defence brief by Rishi Sunak after Ben Wallace formally quit the role he had held for four years under three prime ministers.