Trump denies that he suggested attacking Iran, and apparently shows someone the battle plans prepared by the Pentagon, treating that as proof it was the military's proposal, acting unilaterally.
First, the military prepares plans for all kinds of contingencies, particularly including countries seen to be hostile to the US, and surely including those that have nuclear weapons programs and have been declared by Presidents to be state sponsors of terrorism. I doubt anyone in the Pentagon actually has any idea how many such plans have been made over the years.
But that doesn't necessarily mean they have a practice of bringing these plans to the President and saying, "Let's do it." They may, at times, but contingency plans are contingent, they're not necessarily meant to be acted on.
However, when a president says, "Bring me a plan for attacking country X," he's speaking as the Commander-in-Chief, and military officials have a duty to give him what he asked for. That doesn't mean they agree that the attack ought to take place, and actively advocating against an attack on their role as advisors while supplying the plans in their role as subordinates is in no way contradictory.
What actually happened is not publicly known, and I don't pretend here to say what actually happened. I'm just pointing out that Trump having been given a plan for attacking Iran is in no way evidence that it was the Pentagon who urged it and not him. Nor is it evidence the other way around. It's simply a document he would have whether the Pentagon came to him with a recommendation or he went to them asking for a plan. It proves nothing at all except that at some point in the Trump administration somebody gave thought to attacking Iran. And while that's a bad idea, this is certainly not the first presidential administration in which the idea was raised.