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 fails to update DNS servers #4373

Closed
1 task done
anandb-ripencc opened this issue Mar 16, 2022 · 4 comments · Fixed by #4813
Closed
1 task done

nmcli fails to update DNS servers #4373

anandb-ripencc opened this issue Mar 16, 2022 · 4 comments · Fixed by #4813
Labels
bug This issue/PR relates to a bug module module net_tools plugins plugin (any type)

Comments

@anandb-ripencc
Copy link

Summary

I'm trying to use the nmcli module to set DNS servers for a connection, but it's failing with an error message about the IPv4 gateway.

Issue Type

Bug Report

Component Name

nmcli

Ansible Version

$ ansible --version
ansible [core 2.12.3]
  config file = /Users/anandb/repo/rootsorg/config/ansible/ansible.cfg
  configured module search path = ['/Users/anandb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/anandb/.virtualenvs/ansible_latest/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/anandb/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/anandb/.virtualenvs/ansible_latest/bin/ansible
  python version = 3.10.2 (main, Feb  2 2022, 08:42:42) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.3
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /Users/anandb/.virtualenvs/ansible_latest/lib/python3.10/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 4.6.0

Configuration

$ ansible-config dump --only-changed
DEFAULT_HOST_LIST(/Users/anandb/repo/rootsorg/config/ansible/ansible.cfg) = ['/Users/anandb/repo/rootsorg/config/ansible/hosts']
DEFAULT_TIMEOUT(env: ANSIBLE_TIMEOUT) = 60

OS / Environment

The target OS is an up to date CentOS 7 system

Steps to Reproduce

ansible HOST -m nmcli -a "conn_name=em1 type=ethernet state=present dns6='::1 2620:fe::fe'"

Expected Results

I expected the task to run successfully, and update the DNS servers if necessary.

Actual Results

HOST | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "msg": "Error: Failed to modify connection 'em1': ipv4.gateway: gateway cannot be set if there are no addresses configured\n",
    "name": "em1",
    "rc": 1
}

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 16, 2022
@MrPetkus
Copy link

MrPetkus commented May 9, 2022

Able to reproduce the bug with community.general version 4.8.0 - target system Rocky 8.5

@xeor
Copy link

xeor commented May 18, 2022

Any workaround for this yet?

This was referenced Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module net_tools plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants