The answer is “maybe, but it doesn’t really matter that much.”
As far as the first part of the answer goes, social media is full of people reposting old tweets where Trump accuses Obama of wanting to go to war against Iran for purposes of winning the 2012 elections. Given that Trump is nothing if not an immature, thin-skinned, gaslighter who projects his own faults on others, it is therefore a distinct possibility. Even Max Boot, a conservative who is normally extremely averse to such notions being suggested about U.S. militarism, retweeted a cartoon alleging this very thing.
Or it could just be Trump’s famous impulsiveness leading him to make a rash decision. Trump is as much an exemplar of that sort of behavior as he is of gaslighting, after all. After the U.S. “embassy”* there was attacked, all the mentions of “Benghazi” could well have provoked him into wanting to demonstrate that he’s not as weak as he believes Obama was.
Ultimately, however, it really doesn’t matter very much. Whether Trump blunders into a war he deliberately chose as part of a re-election strategy, or a war he never consciously chose as a result of a knee-jerk reaction, the consequences of a war with Iran would be equally tragic regardless of the cause.
* I put “embassy” in quotes because it’s not an embassy in the commonly-understood meaning of the term (a building in a national capitol that houses another nation’s diplomatic offices). It’s a military base over 100 acres in size and containing multiple buildings and other facilities.