The consensus is that roleplaying started to jell with the Braustein games of Major David Wesley. The short version is that every player portrayed a spy in a Napoleonic era town of Germany. Each player had their own motivations and goals. They were free to whatever they wanted within the town limits. Wesley refereed any actions taken by the players.
Dave Arneson took Wesley's ideas and applied them to the exploration of Blackmoor and it's environs. It is in Arneson's Blackmoor games where all the major elements of roleplaying came together in one game.
Gygax then learned about the Blackmoor game and developed his own Greyhawk game. This turned into the original 3 booklets of Dungeons and Dragons.
In this whole chain of events there is little mentioned of Tolkien. Greyhawk and Blackmoor were no clones of Middle Earth. So Lord of the Rings doesn't look like it had much or any impact on the development of roleplaying.
However where it did have an impact was in the development of the rules for Dungeon & Dragons. And it all goes back to the fantasy supplement to Chainmail.
The first editions of Chainmail did not have any fantasy supplement. In the late 60s Tolkien was rising in popularity. Both the Lord of the Rings and the Hobbit had these cool descriptions of battles that the miniature wargamers of the time wanted to fight out. Coupled with the stories of Howard (Conan) and other fantasy writers of the time you had a strong push to come up with some rules to allow these battles to be fought.
Thus the fantasy supplement to Chainmail was born. Gygax and Perren say flat out why they included these rules
Most of the fantastic battles related in novels more closely resemble medieval warfare than they do earlier or later forms of combat. Because of this we are including a brief set of rules which will allow the medieval miniatures wargamer to a new facet to his hobby, and either refight the epic struggles related by J.R.R. Tolkien, Robert E. Howard, and other fantasy writers; or you can devise your own "world," and conduct fantastic campaigs and conflicts based on it.If you look at the original list of monsters you will see Tolkien creates dominate the list.
The fantasy supplement to Chainmail provided the foundation for the rules used in Blackmoor and Greyhawk and later Dungeons & Dragons itself.
Now Gygax said numerous times that Tolkien wasn't a big influence on him writing D&D and I believe him. When it came time to write original D&D that Gygax was using every source of inspiration available to him.
So while the roleplaying side had little to do with the Tolkien. The game side would not have existed without the desire to refight the battles of Middle Earth. What started out as a way to fight the Hobbit's Battle of Five Armies became much more.
I would say that Tolkien influence waned in the early days of D&D and RPGs as people were using the just about anything they could find or think of to drag into their games. It only rebounded after the Sword of Shannara was published in 1977 and fantasy exploded into mainstream publishing. After the Shannara the big epic fantasy in the style of Tolkien dominated fantasy for a long time with a similar effect on the imagination of the players of D&D.