Repository: ansible-collections/community.general

Issue:
nmcli does not allow editing mtu on VLAN interfaces
### Summary

When trying to edit the mtu parameter on a VLAN interface, nmcli always reports that nothing needs to be done, even though the specified mtu value is different than the current mtu for the VLAN Interface.

This appears to be caused by the function:

```python
    def mtu_conn_type(self):
        return self.type in (
            'dummy',
            'ethernet',
            'team-slave',
        )
```

in `nmcli.py` which fails to recognize the `vlan` interface as a valid layer 2 interface type on which you can set the MTU.



### Issue Type

Bug Report

### Component Name

nmcli

### Ansible Version

```console (paste below)
$ ansible --version
ansible [core 2.12.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.3 (main, Mar 17 2022, 00:10:53) [GCC 8.3.0]
  jinja version = 3.0.3
  libyaml = True
```


### Community.general Version

```console
$ ansible-galaxy collection list community.general

# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 4.6.0

# /usr/local/lib/python3.10/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 4.6.0
```


### Configuration

```console
$ ansible-config dump --only-changed
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
```


### OS / Environment

Rocky Linux 8.5

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml
 - name: Set VLAN 96 network interface MTU to 1500 after creation
    community.general.nmcli:
      conn_name:  "enp1s0f0.96"
      type:              "vlan"
      vlandev:        "enp1s0f0"
      vlanid:           96
      ip4:               "1.2.3.4"
      mtu:             9000
      state:           "present"
```


### Expected Results

```console
$ nmcli conn show enp1s0f096
```

should report:

```console
802-3-ethernet.mtu:                     9000
```

but instead Ansible reports that nothing needs to be changed and the MTU remains at the default for the base interface, 1500.


### Actual Results

```console (paste below)

```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/net_tools/nmcli.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/net_tools/nmcli.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @alcamie101
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->
Files identified in the description:
* [`plugins/modules/nmcli.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/nmcli.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->

Resolving patch:
diff --git a/plugins/modules/net_tools/nmcli.py b/plugins/modules/net_tools/nmcli.py
--- a/plugins/modules/net_tools/nmcli.py
+++ b/plugins/modules/net_tools/nmcli.py
@@ -1765,6 +1765,7 @@ def mtu_conn_type(self):
             'dummy',
             'ethernet',
             'team-slave',
+            'vlan',
         )
 
     @property


Test patch:
diff --git a/tests/unit/plugins/modules/net_tools/test_nmcli.py b/tests/unit/plugins/modules/net_tools/test_nmcli.py
--- a/tests/unit/plugins/modules/net_tools/test_nmcli.py
+++ b/tests/unit/plugins/modules/net_tools/test_nmcli.py
@@ -663,6 +663,7 @@
 ipv6.ignore-auto-dns:                   no
 ipv6.ignore-auto-routes:                no
 vlan.id:                                10
+802-3-ethernet.mtu:                     auto
 """
 
 TESTCASE_VXLAN = [