an option is to create a ansible.cfg file in your project directory.
/my_project
|_ansible.cfg
another option is, if you have a collections folder in your project directory with a requirements.yml.
you can add a source in it.
/my_project
|
|_/collections
|_requirements.yml
requirements.yml
collections:
- name: community.general
version: 7.4.0
source: https://old-galaxy.ansible.com
it worked for me but not a long-term solution because at some point this https://old-galaxy.ansible.com will have EOL.