The wannabe Sultan Erdogan did not get his will in Syria where he had planned to capture and annex Aleppo. The Russians prevented that. He now goes for his secondary target, Mosul in Iraq, which many Turks see as historic part of their country:

At the end of World War I in October 1918, after the signature of the Armistice of Mudros, British forces occupied Mosul. After the war, the city and the surrounding area became part of the Occupied Enemy Territory Administration (1918-1920), and shortly Mandatory Iraq (1920-1932). This mandate was contested by Turkey which continued to claim the area based on the fact that it was under Ottoman control during the signature of the Armistice. In the Treaty of Lausanne, the dispute over Mosul was left for future resolution by the League of Nations. Iraq's possession of Mosul was confirmed by the League of Nations brokered agreement between Turkey and Great Britain in 1926. Former Ottoman Mosul Vilayet eventually became Nineveh Province of Iraq, but Mosul remained the provincial capital.
Mosul, Iraq's second biggest city with about a million inhabitants, is currently occupied by the Islamic State. On Friday a column of some 1,200 Turkish soldiers with some 20 tanks and heavy artillery moved into a camp near Mosul. The camp was one of four small training areas where Turkey was training Kurds and some Sunni-Arab Iraqis to fight the Islamic State. The small camps in the northern Kurdish area have been there since the 1990s. They were first established to fight the PKK. Later their Turkish presence was justified as ceasefire monitors after an agreement ended the inner Kurdish war between the KDP forces loyal to the Barzani clan and the PUK forces of the Talabani clan. The bases were actually used to monitor movement of the PKK forces which fight for Kurdish independence in Turkey.
The base near Mosul is new and it was claimed to be just a small weapons training base. But tanks and artillery have a very different quality than some basic AK-47 training. Turkey says it will increase the numbers in these camps to over 2000 soldiers.
Should Mosul be cleared of the Islamic State the Turkish heavy weapons will make it possible for Turkey to claim the city unless the Iraqi government will use all its power to fight that claim. Should the city stay in the hands of the Islamic State Turkey will make a deal with it and act as its protector. It will benefit from the oil around Mosul which will be transferred through north Iraq to Turkey and from there sold on the world markets. In short: This is an effort to seize Iraq's northern oil fields. That is the plan but it is a risky one. Turkey did not ask for permission to invade Iraq and did not inform the Iraqi government.
The Turks claim that they were invited by the Kurds:
Turkey will have a permanent military base in the Bashiqa region of Mosul as the Turkish forces in the region training the Peshmerga forces have been reinforced, Hürriyet reported.
The deal regarding the base was signed between Kurdistan Regional Government (KRG) President Massoud Barzani and Turkish Foreign Minister Feridun Sinirlioğlu, during the latter’s visit to northern Iraq on Nov. 4.
There are two problems with this.
First: Massoud Barzani is no longer president of the KRG. His mandate ran out and the parliament refused to prolong it.
Second: Mosul and its Bashiqa area are not part of the KRG. Barzani making a deal about it is like him making a deal about Paris.