### Summary

I should be able to manage the `/etc/ansible/ansible.cfg` file on my ansible control host with ansible.  So, when I try this:
```
- name: Install ansible hosts and ansible.cfg
  copy:
    src: "{{ file_directory }}/etc/ansible/{{ item.file }}"
    dest: '/etc/ansible/{{ item.file }}'
    owner: root
    group: root
    mode: '0644'
    backup: yes
    force: yes
    validate: "{{ item.validate }}"
  loop:
  - file: hosts
    validate: /bin/ansible-inventory --list --inventory %s
  - file: ansible.cfg
    validate: /bin/ansible-config list -c %s
```
the validation fails because the file indicated by %s does not have a .cfg extension.

### Issue Type

Bug Report

### Component Name

copy

### Ansible Version

```console
$ ansible --version
ansible [core 2.14.10]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/steve/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /home/steve/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.5 (main, Aug 28 2023, 00:00:00) [GCC 13.2.1 20230728 (Red Hat 13.2.1-1)] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
CONFIG_FILE() = /etc/ansible/ansible.cfg
```


### OS / Environment

Fedora 38 

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
- name: Install ansible hosts and ansible.cfg
  copy:
    src: "{{ file_directory }}/etc/ansible/{{ item.file }}"
    dest: '/etc/ansible/{{ item.file }}'
    owner: root
    group: root
    mode: '0644'
    backup: yes
    force: yes
    validate: "{{ item.validate }}"
  loop:
  - file: hosts
    validate: /bin/ansible-inventory --list --inventory %s
  - file: ansible.cfg
    validate: /bin/ansible-config list -c %s
```


### Expected Results

I expected ansible-config to behave similarly to ansible-inventory, or, failing that to (a) have a different return code for the file extension "error" (not 5) and to test the content before the extension.

### Actual Results

```console
[steve@jabberwock ~]$ ansible-playbook -i shared/ansible/server_IaC/files/arthur/etc/ansible/hosts temp.yml

PLAY [arthur] ****************************************************************************************************************************

TASK [Install ansible hosts and ansible.cfg] *********************************************************************************************
ok: [arthur] => (item={'file': 'hosts', 'validate': '/bin/ansible-inventory --list --inventory %s'})
failed: [arthur] (item={'file': 'ansible.cfg', 'validate': '/bin/ansible-config list -c %s'}) => {"ansible_loop_var": "item", "changed": false, "checksum": "d17e17e9639b5df25890b6ecbab867b9e329f40f", "exit_status": 5, "item": {"file": "ansible.cfg", "validate": "/bin/ansible-config list -c %s"}, "msg": "failed to validate", "stderr": "ERROR! Unsupported configuration file extension for /home/ansible/.ansible/tmp/ansible-tmp-1699292001.685196-111356-55146881241278/source: \n", "stderr_lines": ["ERROR! Unsupported configuration file extension for /home/ansible/.ansible/tmp/ansible-tmp-1699292001.685196-111356-55146881241278/source: "], "stdout": "usage: ansible-config [-h] [--version] [-v] {list,dump,view,init} ...\n\nView ansible configuration.\n\npositional arguments:\n  {list,dump,view,init}\n    list                Print all config options\n    dump                Dump configuration\n    view                View configuration file\n    init                Create initial configuration\n\noptions:\n  --version             show program's version number, config file location,\n                        configured module search path, module location,\n                        executable location and exit\n  -h, --help            show this help message and exit\n  -v, --verbose         Causes Ansible to print more debug messages. Adding\n                        multiple -v will increase the verbosity, the builtin\n                        plugins currently evaluate up to -vvvvvv. A reasonable\n                        level to start is -vvv, connection debugging might\n                        require -vvvv.\n", "stdout_lines": ["usage: ansible-config [-h] [--version] [-v] {list,dump,view,init} ...", "", "View ansible configuration.", "", "positional arguments:", "  {list,dump,view,init}", "    list                Print all config options", "    dump                Dump configuration", "    view                View configuration file", "    init                Create initial configuration", "", "options:", "  --version             show program's version number, config file location,", "                        configured module search path, module location,", "                        executable location and exit", "  -h, --help            show this help message and exit", "  -v, --verbose         Causes Ansible to print more debug messages. Adding", "                        multiple -v will increase the verbosity, the builtin", "                        plugins currently evaluate up to -vvvvvv. A reasonable", "                        level to start is -vvv, connection debugging might", "                        require -vvvv."]}

PLAY RECAP *******************************************************************************************************************************
arthur                     : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
"""
        This is a closure (function utilizing variables from it's parent
        function's scope) so that we only need one copy of all the containers.
        Note that this function uses side effects (See the Variables used from
        outer scope).
        :arg topdir: The directory we are walking for files
        :arg rel_offset: Integer defining how many characters to strip off of
            the beginning of a path
        :arg parent_dirs: Directories that we're copying that this directory is in.
        :kwarg rel_base: String to prepend to the path after ``rel_offset`` is
            applied to form the relative path.