According to the PHB and the SRD Ranged Attacks are defined as follows:
You can make Ranged Attacks only against Targets within a specified range. If a ranged Attack, such as one made with a spell, has a single range, you can’t Attack a target beyond this range. Some Ranged Attacks, such as those made with a Longbow or a Shortbow, have two ranges. The smaller number is the normal range, and the larger number is the long range. Your Attack roll has disadvantage when your target is beyond normal range, and you can’t Attack a target beyond the long range.
It then goes on to state that:
Aiming a ranged Attack is more difficult when a foe is next to you. When you make a ranged Attack with a weapon, a spell, or some other means, you have disadvantage on the Attack roll if you are within 5 feet of a Hostile creature who can see you and who isn’t Incapacitated.
Therefore, say someone is operating a Ballista, and on their turn someone moves into Melee range of them (the operator) would then the Ballista gain disadvantage on it’s next attack roll?