Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nmcli does not allow editing mtu on VLAN interfaces #4387

Closed
1 task done
jfpanisset opened this issue Mar 22, 2022 · 3 comments · Fixed by #6104
Closed
1 task done

nmcli does not allow editing mtu on VLAN interfaces #4387

jfpanisset opened this issue Mar 22, 2022 · 3 comments · Fixed by #6104
Labels
bug This issue/PR relates to a bug has_pr module module net_tools plugins plugin (any type)

Comments

@jfpanisset
Copy link
Contributor

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:

    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

$ 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

$ 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

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

OS / Environment

Rocky Linux 8.5

Steps to Reproduce

 - 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

$ nmcli conn show enp1s0f096

should report:

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

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

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

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module net_tools plugins plugin (any type) labels Mar 22, 2022
jfpanisset added a commit to jfpanisset/community.general that referenced this issue Mar 22, 2022
ansible-collections#4387

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>
@ansibullbot
Copy link
Collaborator

Files identified in the description:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment