### Summary

https://github.com/ansible/ansible/issues/31982 is back.



### Issue Type

Bug Report

### Component Name

lineinfile

### Ansible Version

```console
$ ansible --version
ansible 2.10.8
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0]
```


### Configuration

```console
$ ansible-config dump --only-changed
$
```


### OS / Environment

Ubuntu 21.10 Server in a VirtualBox, on server and clients, nothing special

### Steps to Reproduce

```
- name: "Check DNS configuration: Remove search list"
  ansible.builtin.lineinfile:
    backup: "yes"
    path: "/etc/resolv.conf"
    line: "search x.tld"
    state: "absent"

- name: "Check DNS configuration: Cache servers present"
  ansible.builtin.lineinfile:
    backup: "yes"
    line: "{{ item }}"
    path: "/etc/resolv.conf"
    state: "present"
  with_items:
    - "nameserver x.x.x.x"
    - "nameserver y.y.y.y"
```

### Expected Results

The file is modified, a backup is created.

### Actual Results

```console
<x.x.x.x> (1, b'\r\n{"path": "/etc/resolv.conf.2410.2022-01-11@10:36:56~", "details": "Error while setting attributes: /etc/resolv.conf.2410.2022-01-11@10:36:56~: Operation not supported\\n", "exception": "Traceback (most recent call last):\\n  File \\"/tmp/ansible_ansible.builtin.lineinfile_payload_pvwbc704/ansible_ansible.builtin.lineinfile_payload.zip/ansible/module_utils/basic.py\\", line 1256, in set_attributes_if_different\\n    raise Exception(\\"Error while setting attributes: %s\\" % (out + err))\\nException: Error while setting attributes: /etc/resolv.conf.2410.2022-01-11@10:36:56~: Operation not supported\\n\\n", "failed": true, "msg": "chattr failed", "uid": 101, "gid": 103, "owner": "systemd-resolve", "group": "systemd-resolve", "mode": "0644", "state": "file", "size": 920, "invocation": {"module_args": {"backup": true, "line": "nameserver x.x.x.x", "path": "/etc/resolv.conf", "state": "present", "backrefs": false, "create": false, "firstmatch": false, "unsafe_writes": false, "regexp": null, "insertafter": null, "insertbefore": null, "validate": null, "mode": null, "owner": null, "group": null, "seuser": null, "serole": null, "selevel": null, "setype": null, "attributes": null}}}\r\n', b'Shared connection to x.x.x.x closed.\r\n')
<x.x.x.x> Failed to connect to the host via ssh: Shared connection to x.x.x.x closed.
<x.x.x.x> ESTABLISH SSH CONNECTION FOR USER: root
<x.x.x.x> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/4c20d84404 x.x.x.x '/bin/sh -c '"'"'rm -f -r /root/.ansible/tmp/ansible-tmp-1641897416.2652106-3817-66846454678877/ > /dev/null 2>&1 && sleep 0'"'"''
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_ansible.builtin.lineinfile_payload_bccsus14/ansible_ansible.builtin.lineinfile_payload.zip/ansible/module_utils/basic.py", line 1256, in set_attributes_if_different
    raise Exception("Error while setting attributes: %s" % (out + err))
Exception: Error while setting attributes: /etc/resolv.conf.2577.2022-01-11@10:36:56~: Operation not supported

failed: [x.x.x.x] (item=nameserver x.x.x.x) => {
    "ansible_loop_var": "item",
    "changed": false,
    "details": "Error while setting attributes: /etc/resolv.conf.2577.2022-01-11@10:36:56~: Operation not supported\n",
    "gid": 103,
    "group": "systemd-resolve",
    "invocation": {
        "module_args": {
            "attributes": null,
            "backrefs": false,
            "backup": true,
            "create": false,
            "firstmatch": false,
            "group": null,
            "insertafter": null,
            "insertbefore": null,
            "line": "nameserver x.x.x.x",
            "mode": null,
            "owner": null,
            "path": "/etc/resolv.conf",
            "regexp": null,
            "selevel": null,
            "serole": null,
            "setype": null,
            "seuser": null,
            "state": "present",
            "unsafe_writes": false,
            "validate": null
        }
    },
    "item": "nameserver x.x.x.x",
    "mode": "0644",
    "msg": "chattr failed",
    "owner": "systemd-resolve",
    "path": "/etc/resolv.conf.2577.2022-01-11@10:36:56~",
    "size": 946,
    "state": "file",
    "uid": 101
}
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
return safe_eval(value, locals, include_exceptions)
    def _load_params(self):
        ''' read the input and set the params attribute.
        This method is for backwards compatibility.  The guts of the function
        were moved out in 2.1 so that custom modules could read the parameters.
        '''
        
        self.params = _load_params()
    def _log_to_syslog(self, msg):
        if HAS_SYSLOG:
            try:
                module = 'ansible-%s' % self._name
                facility = getattr(syslog, self._syslog_facility, syslog.LOG_USER)
                syslog.openlog(str(module), 0, facility)
                syslog.syslog(syslog.LOG_INFO, msg)
            except (TypeError, ValueError) as e:
                self.fail_json(
                    msg='Failed to log to syslog (%s). To proceed anyway, '
                        'disable syslog logging by setting no_target_syslog '
                        'to True in your Ansible config.' % to_native(e),
                    exception=traceback.format_exc(),
                    msg_to_log=msg,
                )
    def debug(self, msg):