Turkey has more than two hands and more in the Iraq/Syrian war.
Turkey is always been famous for its multiple dealings since its Ottoman empire status.
On one side it supported the rise of the Islamic State and still supports it to achieve its political objectives ((for example to clear of Syrian Kurds the “buffer zone” between Syria and Turkey- so it can then claim for itself.
It unwillingly support the US led coalition. And warily supports the Iraqi Kurds.
Moreover it has 60 special forces protecting the tomb of the Sulemain as Turkish enclave surrounded by the Islamic State (almost waiting for an accident to happen, instead of evacuating).
The Kurdish PKK are really considering the reopening of the hostilities with Turkey.
As it is supporting contrasting parties (it even “let pass” Kurdish oil to Israel) it is creating further instability for everyone in the region, also itself.