A NATO/Ukraine Counterfactual

Some commentators argue that we drove Putin to desperate measures by expanding NATO to Russia’s borders. Is that correct? Would he have invaded Ukraine if the expansion had not occurred?

A month ago, I took the position that Putin was focused on dividing NATO, and would continue to turn the pressure on and off in lieu of invading. An invasion would only unify NATO and turn European public opinion against him. He must have known that, but he invaded anyway. That tells me his real objective was to inhale Ukraine at any cost, and that NATO expansion was just a pretext.