### Summary

I have a playbook as follows:
```
  - name: Change the hostname
    hostname:
      name: example.com
```
I have also tried:

```
  - name: Change the hostname
    hostname:
      name: example.com
      use: systemd
```


Changing hostname on CentOS Stream 8 using the above playbook causes the target machine to log the following output in none stop way:

```
Feb  6 03:43:41 172-105-183-143 NetworkManager[772]: <info>  [1644119021.3649] policy: set-hostname: current hostname was changed outside NetworkManager: 'example.com'
Feb  6 03:43:42 172-105-183-143 NetworkManager[772]: <info>  [1644119022.3647] policy: set-hostname: current hostname was changed outside NetworkManager: 'example.com'
Feb  6 03:43:42 172-105-183-143 NetworkManager[772]: <info>  [1644119022.3651] policy: set-hostname: current hostname was changed outside NetworkManager: 'example.com'
Feb  6 03:43:43 172-105-183-143 NetworkManager[772]: <info>  [1644119023.3646] policy: set-hostname: current hostname was changed outside NetworkManager: 'example.com'
Feb  6 03:43:43 172-105-183-143 NetworkManager[772]: <info>  [1644119023.3649] policy: set-hostname: current hostname was changed outside NetworkManager: 'example.com'
```

However, when I log into the target machine and run the following command, it stops producing unnecessary logs.

```hostnamectl set-hostname example.com```

OS details of the target machine:
```
NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
```

The same issue is also logged here:
https://bugzilla.redhat.com/show_bug.cgi?id=1894137

However, I am not getting the issue when I run the command 'hostnamectl' directly in the box but only when I update the hostname using Ansible playbook.

Ansible version I am using:
```
➜  ~ ansible --version
ansible [core 2.12.2]
  config file = None
  configured module search path = ['/Users/gehendra/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/gehendra/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.8 (main, Nov 10 2021, 09:21:22) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.3
  libyaml = True
```


Your help would be highly appreciated. 
Thank you.






### Issue Type

Bug Report

### Component Name

ansible

### Ansible Version

```console
$ ansible --version
ansible [core 2.12.2]
  config file = None
  configured module search path = ['/Users/gehendra/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/gehendra/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.8 (main, Nov 10 2021, 09:21:22) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.3
  libyaml = True
```


### Configuration

```console
$ ansible-config dump --only-changed
(END)

Nothing was produced at all.
```


### OS / Environment

[ga@example ~]$ cat /etc/os-release
NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)

  - name: Change the hostname
    hostname:
      name: example.com

or

  - name: Change the hostname
    hostname:
      name: example.com
      use: systemd
```


### Expected Results

I do not want the garbage/error logs to be written every second.


### Actual Results

```console
No errors are displayed when running the playbook on the control machine.
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
def __init__(self, module):
        self.module = module
        self.changed = False
    def update_current_and_permanent_hostname(self):
        self.update_current_hostname()
        self.update_permanent_hostname()
        return self.changed
    def update_current_hostname(self):
        name = self.module.params['name']
        current_name = self.get_current_hostname()
        if current_name != name:
            if not self.module.check_mode:
                self.set_current_hostname(name)
            self.changed = True
    def update_permanent_hostname(self):
        name = self.module.params['name']
        permanent_name = self.get_permanent_hostname()
        if permanent_name != name:
            if not self.module.check_mode:
                self.set_permanent_hostname(name)
            self.changed = True
    def get_current_hostname(self):
        return self.get_permanent_hostname()
    def set_current_hostname(self, name):
        pass
    def get_permanent_hostname(self):
        raise NotImplementedError
    def set_permanent_hostname(self, name):
        raise NotImplementedError
class UnimplementedStrategy(BaseStrategy):