Iraq 's prime minister has named his defense and interior ministers , and a head of national security , following weeks of negotiations over the posts .