ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
793 stars 1.46k forks source link

The mode parameter of community.general.nmcli does not take effect for team connection #1950

Closed 18660155632 closed 3 years ago

18660155632 commented 3 years ago

Summary

I want to create a connection of type team, mode is active-backup. But the setting does not take effect

Issue Type

Bug Report

Component Name

nmcli

Ansible Version

ansible 2.10.6
python version = 3.7.6 (default, Dec 30 2019, 19:38:28) [Clang 11.0.0 (clang-1100.0.33.16)]

Configuration

OS / Environment

No response

Steps To Reproduce

- name: add team1
      community.general.nmcli:
        type: team
        conn_name: team1
        ip4: 1.1.1.1/24
        gw4: 1.1.1.254
        mode: active-backup
        state: present

Expected Results

No response

Actual Results

#nmcli con show team1

team.runner:                            roundrobin
ansibullbot commented 3 years ago

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

ansibullbot commented 3 years ago

Files identified in the description:

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

ansibullbot commented 3 years ago

cc @alcamie101 @nerzhul click here for bot help

omula commented 3 years ago

As far as I can see the mode is not used for configuring teaming devices. Red Hat documentation show that json format can be used to specify the configuration for the team.

I am considering implementing something like the sample below and then use team_config in json format in nmcli.py. Would you add checking for team_config parameters or just let nmcli validate it? What do you think?

- name: Add an Team connection with static IP configuration
  community.general.nmcli:
    conn_name: team2
    ifname: team2
    type: team
    ip4: 192.0.2.100/24
    gw4: 192.0.2.1
    state: present
    autoconnect: yes
    team_config:
      runner:
        name: activebackup
        hwaddr_policy: by_active
      link_watch:
        name: ethtool
omula commented 3 years ago

@felixfontein what are your thoughts?

felixfontein commented 3 years ago

@omula I personally prefer strict validation, but I know that others do not want that. Since I'm not maintaining and using that module, my preferences are not that important :)