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 always returning "changed" #3612

Closed
1 task done
haddystuff opened this issue Oct 25, 2021 · 2 comments · Fixed by #3625
Closed
1 task done

nmcli always returning "changed" #3612

haddystuff opened this issue Oct 25, 2021 · 2 comments · Fixed by #3625
Labels
bug This issue/PR relates to a bug module module net_tools plugins plugin (any type)

Comments

@haddystuff
Copy link
Contributor

Summary

community.general.nmcli always returning "changed" when running task with dummy interface even though there is nothing to change. Found this problem on Ubuntu 20.04 controller node but also was able to reproduce it on Fedora 34. I ran this task with --check --diff flags and found out that nmcli trying to change "802-3-ethernet.mtu" parameter. I also found similar issue here but it's not clear if this problem is the same.

Issue Type

Bug Report

Component Name

nmcli
community.general : 3.8.0

Ansible Version

ansible [core 2.11.6] 
  config file = /home/alex/ansible/ansible.cfg
  configured module search path = ['/home/alex/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/alex/.virtualenvs/latest_ansible/lib64/python3.9/site-packages/ansible
  ansible collection location = /home/alex/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/alex/.virtualenvs/latest_ansible/bin/ansible
  python version = 3.9.7 (default, Aug 30 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
  jinja version = 3.0.2
  libyaml = True

Community.general Version

Collection        Version
----------------- -------
community.general 3.8.0  

Configuration

DEFAULT_BECOME(/home/alex/ansible/ansible.cfg) = False
DEFAULT_BECOME_METHOD(/home/alex/ansible/ansible.cfg) = sudo
DEFAULT_HOST_LIST(/home/alex/ansible/ansible.cfg) = ['/home/alex/ansible/hosts.ini']
DEFAULT_REMOTE_USER(/home/alex/ansible/ansible.cfg) = ansible
HOST_KEY_CHECKING(/home/alex/ansible/ansible.cfg) = False

OS / Environment

Controller Node : Ubuntu 20.04, Fedora 34
Target Node : RHEL 8.3, Fedora 34, Ubuntu 20.04

Steps to Reproduce

- name: nmcli set interface
  community.general.nmcli:
    conn_name: dummy_con0
    ifname: dummy0
    ip4: 10.0.0.151/32
    state: present
    type: dummy

Expected Results

I expect to recive something this after running playbook

TASK [nmcli set interface] ****************************************************************************************************
OK: [redhat]
OK: [personal]

Actual Results

Got this result

TASK [nmcli set interface] ****************************************************************************************************
changed: [redhat]
changed: [personal]

so i reran this playbook with --diff --check and got this

TASK [nmcli set interface] *********************************************************************************************************************************************************************
--- before
+++ after
@@ -1,5 +1,5 @@
 {
-    "802-3-ethernet.mtu": null,
+    "802-3-ethernet.mtu": "auto",
     "connection.autoconnect": "yes",
     "connection.interface-name": "dummy0",
     "ipv4.addresses": "10.0.0.151/32",

changed: [redhat]
--- before
+++ after
@@ -1,5 +1,5 @@
 {
-    "802-3-ethernet.mtu": null,
+    "802-3-ethernet.mtu": "auto",
     "connection.autoconnect": "yes",
     "connection.interface-name": "dummy0",
     "ipv4.addresses": "10.0.0.151/32",

changed: [personal]

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

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