Musharraf appoints ally as caretaker prime minister