Repository: ansible-collections/community.general

Issue:
nmcli vlan arguments for egress, flags, and ingress aren't used
<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
<!--- Explain the problem briefly below -->
The following arguments have no effect on `nmcli` connections of type `vlan`:
* [`flags`](https://docs.ansible.com/ansible/latest/collections/community/general/nmcli_module.html#parameter-flags)
* [`ingress`](https://docs.ansible.com/ansible/latest/collections/community/general/nmcli_module.html#parameter-ingress)
* [`egress`](https://docs.ansible.com/ansible/latest/collections/community/general/nmcli_module.html#parameter-egress)

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
`nmcli`

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible 2.10.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/jbronn/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/jbronn/.local/lib/python3.8/site-packages/ansible
  executable location = /home/jbronn/.local/bin/ansible-playbook
  python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
N/A
##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
Ubuntu 20.04, Python 3.8.5.

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
<!--- Paste example playbooks or commands between quotes below -->
```yaml
- hosts: all
  become: true
  tasks:
    - nmcli:
        conn_name: home-test
        state: present
        type: vlan
        ifname: enp0s31f6.100
        vlandev: enp0s31f6
        vlanid: 100
        flags: '4'
  vars:
    ansible_python_interpreter: '/usr/bin/python3'
```

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->
Running the following playbook, I'd expect the `home-test` connection to have `vlan.flags` be set to 4 (`LOOSE_BINDING`).

##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->
The connection `vlan.flags` are the default `1` (`REORDER_HEADERS`):
<!--- Paste verbatim command output between quotes -->
```paste below
$ nmcli con show home-test | grep ^vlan
vlan.parent:                            enp0s31f6
vlan.id:                                100
vlan.flags:                             1 (REORDER_HEADERS)
vlan.ingress-priority-map:              --
vlan.egress-priority-map:               --
```

##### ADDITIONAL NOTES

* It's easy to see in the module source that `vlan.flags`, `vlan.egress`, and `vlan.ingress` aren't used in [`Nmcli.{create,modify}_connection_vlan()`](https://github.com/ansible-collections/community.general/blob/e48083e66b3b2fa0695b6fc71c4fb33247a79a4a/plugins/modules/net_tools/nmcli.py#L1146-L1205).
* I think the type of `flags` should actually be an integer to reflect that `vlan.flags` is actually `uint32` (`NMVlanFlags`) and `egress` / `ingress` should be lists of strings to reflect that they are list of 802.1p priority mappings (see `man nm-settings`).


Discussion:
Files identified in the description:
None

If these files are inaccurate, 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/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
Files identified in the description:
* [`plugins/modules/net_tools/nmcli.py`](https://github.com/ansible-collections/community.general/blob/master/plugins/modules/net_tools/nmcli.py)

If these files are inaccurate, 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/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @alcamie101 @nerzhul
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->
+label waiting_on_contributor

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
@@ -1373,6 +1373,9 @@ def connection_options(self, detect_change=False):
             options.update({
                 'vlan.id': self.vlanid,
                 'vlan.parent': self.vlandev,
+                'vlan.flags': self.flags,
+                'vlan.ingress': self.ingress,
+                'vlan.egress': self.egress,
             })
         elif self.type == 'vxlan':
             options.update({


Test patch: