### Summary

When I try to install a role that contains files with `$` in their names (such as Java class names), it fails because we don't allow `$` in the file names because file names could get evaluated via `os.path.expandvars`.

See https://github.com/ansible/galaxy/issues/271 for the original context

The error message is "Not a directory" (errno 20).

### Issue Type

Bug Report

### Component Name

role

### Ansible Version

```console
$ ansible --version
ansible [core 2.14.5]
  config file = /Users/atsalolikhin/.ansible.cfg
  configured module search path = ['/Users/atsalolikhin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/atsalolikhin/py-3.9.13/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/atsalolikhin/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/atsalolikhin/py-3.9.13/bin/ansible
  python version = 3.9.13 (main, Jul 20 2022, 17:45:35) [Clang 13.0.0 (clang-1300.0.29.3)] (/Users/atsalolikhin/py-3.9.13/bin/python3.9)
  jinja version = 3.0.3
  libyaml = True
```


### Configuration

 N/A
 


### OS / Environment

N/A

### Steps to Reproduce


Add this to your `requirements.yaml`:

```yaml
- src: https://gitlab.com/atsaloli/ansible-galaxy-issue-271.git
  version: main
  scm: git
```

and then try to install roles, with e.g., `ansible-galaxy install -r requirements.yml`

### Expected Results

I expected the role to be installed.

### Actual Results

```console
The role install failed.


$ ansible-galaxy install -r requirements.yml --force
Starting galaxy role install process
- extracting ansible-galaxy-issue-271 to /home/atsaloli/.ansible/roles/ansible-galaxy-issue-271
[WARNING]: - ansible-galaxy-issue-271 was NOT installed successfully: Could not update files in /home/atsaloli/.ansible/roles/ansible-galaxy-issue-271:
[Errno 20] Not a directory: '/home/atsaloli/.ansible/roles/ansible-galaxy-issue-271/files/udf/CMC_VWAP.class'
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
$
```
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
"""
        Returns role spec info
        {
           'scm': 'git',
           'src': 'http://git.example.com/repos/repo.git',
           'version': 'v1.0',
           'name': 'repo'
        }
        """
        return dict(scm=self.scm, src=self.src, version=self.version, name=self.name)
    @property
    def requirements(self):