I have written an answer to the duplicate challenging the facts as asserted in the question.
The rest of the answer addresses a difference between the 2017 executive order and a hypothetical 6-month suspension of Iraqi refugee processing.
In addition to the points raised in DJ Clayworth's answer, I would like to add the perspective of Rep. Justin Amash (R-MI) on the legality (presumably, under U.S. law) of 2011 suspension vs. 2017:
Many supporters and opponents of President Trump's executive order are conflating the terms "immigrant" (which encompasses green card holders), "nonimmigrant," and "refugee."
It's not lawful to ban immigrants because of "nationality, place of birth, or place of residence." This nondiscrimination provision comes from a 1965 law (8 U.S.C. 1152 Sec. 202(a)(1)(A)) that limits the 1952 law (8 U.S.C. 1182 Sec. 212(f)) that the president cites.
It's lawful to ban nonimmigrants for almost any reason. These are people who are temporarily visiting the United States, like tourists or students.
It's lawful to ban refugees for almost any reason. But banning all refugees from particular countries is harsh and unwise. We still should admit well-vetted persons.
Understanding these distinctions is important because supporters of President Trump's executive order continue to wrongly insist that the order is lawful and that President Obama did almost the same thing in 2011. And opponents of President Trump's executive order continue to wrongly insist that banning refugees violates the Constitution or the law.
President Trump's executive order covers not only refugees but also immigrants and nonimmigrants. As noted above, it's not lawful to discriminate in the issuance of an immigrant visa because of the person's "nationality, place of birth, or place of residence."
President Obama's action (which wasn't disclosed at the time) covered only refugees and, therefore, did not violate the Constitution or the law, even if one finds it objectionable for other reasons.
Regarding green card holders, a CNN report alleges that "Friday night, DHS arrived at the legal interpretation that the executive order restrictions... did not apply to people with lawful permanent residence, generally referred to as green card holders" and that guidance sent to airlines on Friday night said that "lawful permanent residents are not included and may continue to travel to the USA", but that the "White House overruled that guidance overnight". A DHS spokesperson also told Reuters on Saturday that the executive order "will bar green card holders".
On Sunday evening, the Department of Homeland Security announced that entry of lawful permanent residents (green card holders) would be deemed "to be in the national interest", that they would be evaluated on a "case-by-case" basis but that "lawful permanent resident status will be a dispositive factor".