I ran into a thread elsewhere on reddit that was discussing how Romans might deal with medieval knights, and someone suggested equipping blunt weapons like maces or clubs.
So my question is how much influence did a Roman general have over the 'loadout' of their army? Could they requisition special equipment and modify the equipment of their troops, or could they fill their regiments with more or less of any particular unit type(Cavalry, Skirmishers)?
As for time period, I think post marian reforms would be most applicable, though if you want to say something about the Republic I would be more than happy to read it!
In principle, a Roman general did not decide the arms of his troops. In Republican times, soldiers would bring their own equipment from home. Half of them would not even be Romans, but Italian allies bringing equipment from their own communities.
Getting more cavalry in their armies in particular would pretty much be impossible. Cavalry was recruited from the richest social classes, who were the only ones who could afford horses. By definition these were the smallest classes, and the hardest to scale up.
Roman legions in Republican times were not entirely inflexible. In times of great crisis the senate sometimes summoned larger levies to raise over-sized legions. This happened most notably during the second Punic War, and explains why the Roman army at Cannae was so large. But they were constrained in which kinds of troops they could get more of: basic infantry and skirmishers could be found, but the veteran triarii and expensive cavalry could not, and those remained at normal strength.
With other allies and mercenaries there sometimes was more leeway and these could provide a Roman army with additional specialists. For example, Lucius Aemelius Paullus' army in the third Macedonian war had Numidian allies and even included war-elephants. In his Gallic wars, Caesar used Cretan archers and Balearic slingers for light infantry, and Numidian, German and Gallic allied cavalry. (Though it should be noted that by Ceasar's day he could get away with a lot more than generals in previous centuries)
In Imperial times the legions were long-standing formations organised according to the general standards of the Roman army and traditions of their units, not formations individual generals could change at a whim. If anything, generals were more constrained in their actions than they had been in the Republic.
That said, as the imperial period went on armies tended to consist less and less of legions mustered wholesale, and more of detachments (known as vexillations) from many different units gathered for specific campaigns. This made campaign armies more flexible than the old standard consular armies had been. The Romans had learned their lessons and always tended to bring plenty of cavalry and missile-armed troops when fighting cavalry-focussed enemies like the Parthians. This would not have been the decision of an individual general though, as such large campaigns tended to involve the emperors in person, and troops gathered from all over the region.
On the topic of weapons: we do have some anecdotes describing generals doing something like what you mention. For example, Plutarch claims that Marcellus won the battle of Nola against Hannibal because:
He had distributed long spears used in naval combats among his infantry, and taught them to watch their opportunity and smite the Carthaginians at long range; these were not javelineers, but used short spears in hand-to‑hand fighting. This seems to have been the reason why at that time all the Carthaginians who were engaged turned their backs upon the Romans and took to unhesitating flight, losing five thousand of their number slain, and six hundred prisoners; four of their elephants also were killed, and two taken alive.
Polybius offers a similar description of the battle of the river Clusius:
The Tribunes accordingly gave out the spears of the Triarii, who are the last of the three ranks, to the first ranks, or Hastati: and ordering the men to use their swords only, after their spears were done with, they charged the Celts full in front.
I have some doubts about these explanations for why these battles were won, but they do indicate that changing equipment was not unknown. Though note that in both cases they are re-distributing weapons they already had, not making or getting new weapons.
As for fighting knights... the Romans did fight quite a few battles against armoured cavalry, namely the Parthian cataphracts. And we have several descriptions of legionaries being ordered to use their pila as thrusting spears instead of their swords, to be able to attack the cavalry with greater reach. (Also when fighting other types of cavalry) There are several battles in which the legionaries defeat cataphracts in hand-to-hand combat.
A very interesting text on this subject is Arrian's "Array against the Alans," which is a plan for arranging his army to fend off an attack by a steppe cavalry army. It's a theoretical text or plan, and we don't know if it was ever put into practice. But again, it's notable that while Arrian spends a lot of time detailing how his troops should be arranged and how they should be using their weapons to defend against cavalry, he does not include any new or unusual weapons. He says that the troops should form up in a dense phalanx-like formation, and that the front ranks should use their heavy pila as thrusting spears, while the rear ranks should throw lighter javelins over their heads and behind them foot archers and horse archers and artillery should provide even more covering fire.
There are no descriptions or mentions of any attempt to change soldiers' basic equipment. The closest example of something like that we have is the armour reinforcements that pop up during the Dacian wars, presumably to help the soldiers deal with the fearsome Dacian falx. (Though more recent evidence muddies the waters, as we've found similar armour in regions far away from Dacia.)
So in summary: generals had no real leeway to change the composition of their armies, unless they could get allied or mercenary troops to support them. Generals could and did change formations and deployments. We also have a few (very few) anecdotes of generals swapping equipment around, but we have no evidence of completely novel equipment being issued. What descriptions we do have of Roman anti-cavalry tactics clearly do not involve anything like that.