### Summary

The file module "mode: a=,ug=rX" seems to behave differently than "chmod" for the same mode.

If you have a file that is mode 755 and you tell the file module "mode: a=,ug=rX",  the mode will be set to 550.  If, however, that file starts as mode 644, the mode will be set to 440.  Chmod with that same mode string in both cases results in 440.  It seems to be preserving the previous "x" status.

It seems to be related to the "a=", because without that file and chmod work the same.

The workaround is to use "ug=rX,o=" rather than "a=,ug=rX", but Ansible probably wants to match chmod in this.

### Issue Type

Bug Report

### Component Name

file

### Ansible Version

```console
$ ansible --version

ansible [core 2.15.0.dev0] (devel cc8e6d06d0) last updated 2023/03/02 15:23:16 (GMT -600)
  config file = None
  configured module search path = ['/home/sean/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /tmp/ansible/lib/ansible
  ansible collection location = /home/sean/.ansible/collections:/usr/share/ansible/collections
  executable location = /tmp/ansible/bin//ansible
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] (/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() = None
EDITOR(env: EDITOR) = lvim
```


### OS / Environment

Ubuntu 22.04

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
---
- hosts: 127.0.0.1
  connection: local
  gather_facts: no

  tasks:
    - name: Setup the directory and file
      shell: "rm -rf test_directory; mkdir test_directory; date >test_directory/test_file"

    - name: Change mode of file to 755
      command: "chmod 755 test_directory/test_file"

    - name: Starting permissions
      shell: "ls -la test_directory/test_file >/dev/tty"

    - name: File module sets mode a=,ug=rX
      file:
        path: test_directory/test_file
        mode: a=,ug=rX

    - name: After file module sets mode to a=,ug=rX
      shell: "ls -la test_directory/test_file >/dev/tty"

    - name: Use chmod to do the same chmod as the file module just did
      command: "chmod -R a=,ug=rX test_directory/test_file"

    - name: The permissions should be the same here (same mode specified).
      shell: "ls -la test_directory/test_file >/dev/tty"

    - name: Run file module again, does it produce same results as last time?
      file:
        path: test_directory/test_file
        mode: a=,ug=rX

    - name: 'This should be the same as "File module sets mode" above, same permissions were given'
      shell: "ls -la test_directory/test_file >/dev/tty"
```


### Expected Results

"file" set test_file to mode 550, "chmod" with same mode sets it to 440, "file" run again with the same mode argument leaves the mode at 440, unlike the first pass.

I would expect "a=,..." to set a specific mode, which is what chmod does.

### Actual Results

```console
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
localhost does not match 'all'

PLAY [127.0.0.1] ****************************************************************************

TASK [Setup the directory and file] *********************************************************
[WARNING]: Consider using the file module with state=absent rather than running 'rm'.  If
you need to use command because file is insufficient you can add 'warn: false' to this
command task or set 'command_warnings=False' in ansible.cfg to get rid of this message.
changed: [127.0.0.1]

TASK [Change mode of file to 755] ***********************************************************
[WARNING]: Consider using the file module with mode rather than running 'chmod'.  If you
need to use command because file is insufficient you can add 'warn: false' to this command
task or set 'command_warnings=False' in ansible.cfg to get rid of this message.
changed: [127.0.0.1]

TASK [Starting permissions] *****************************************************************
-rwxr-xr-x 1 sean sean 32 Mar  2 15:25 test_directory/test_file
changed: [127.0.0.1]

TASK [File module sets mode a=,ug=rX] *******************************************************
changed: [127.0.0.1]

TASK [After file module sets mode to a=,ug=rX] **********************************************
-r-xr-x--- 1 sean sean 32 Mar  2 15:25 test_directory/test_file
changed: [127.0.0.1]

TASK [Use chmod to do the same chmod as the file module just did] ***************************
changed: [127.0.0.1]

TASK [The permissions should be the same here (same mode specified).] ***********************
-r--r----- 1 sean sean 32 Mar  2 15:25 test_directory/test_file
changed: [127.0.0.1]

TASK [Run file module again, does it produce same results as last time?] ********************
ok: [127.0.0.1]

TASK [This should be the same as "File module sets mode" above, same permissions were given] ***
-r--r----- 1 sean sean 32 Mar  2 15:25 test_directory/test_file
changed: [127.0.0.1]

PLAY RECAP **********************************************************************************
127.0.0.1                  : ok=9    changed=8    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
```
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
''' Remove strings that look like passwords from log messages '''
    
    
    
    
    
    
    
    
    
    
    data = to_native(data)
    output = []
    begin = len(data)
    prev_begin = begin
    sep = 1
    while sep:
        
        try:
            end = data.rindex('@', 0, begin)
        except ValueError:
            
            output.insert(0, data[0:begin])
            break
        
        sep = None
        sep_search_end = end
        while not sep: