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

When creating a bonded InfiniBand re-running the role gives 'Interface ib0 is of an unexpected type' #134

Open
Aethylred opened this issue Sep 16, 2022 · 2 comments

Comments

@Aethylred
Copy link
Contributor

The interface type for a bonded Infinband interface should either not be defined, ot be InfiniBand, but not ether as per

https://github.com/michaelrigart/ansible-role-interfaces/blob/master/filter_plugins/filters.py#L234

The variables I'm using for this are:

interfaces_bond_interfaces:
  - device: "ib-bond0"
    bootproto: static
    address: "{{ ib_ip }}"
    netmask: "{{ ib_netmask }}"
    type: ipoib
    bond_mode: active-backup
    bond_slaves:
      - ib0
      - ib1

I'm expectin the type: ipoib to do "the right thing"

Error output:

RUNNING HANDLER [michaelrigart.interfaces : Check active bond interface state] *********************************************************************************************************************************************************************
task path: /home/test/ib_playbooks/ignore/roles/michaelrigart.interfaces/handlers/main.yml:182
failed: [test01] (item={'device': 'ib-bond0', 'bootproto': 'static', 'address': '10.0.0.1', 'netmask': '255.255.252.0', 'type': 'ipoib', 'bond_mode': 'active-backup', 'bond_slaves': ['ib0', 'ib1']}) => changed=false 
  ansible_loop_var: item
  item:
    address: 10.0.0.1
    bond_mode: active-backup
    bond_slaves:
    - ib0
    - ib1
    bootproto: static
    device: ib-bond0
    netmask: 255.255.252.0
    type: ipoib
  msg: Interface ib0 is of an unexpected type
@Aethylred
Copy link
Contributor Author

The bonded IB interface works as configured by the first run works BTW, it's the second run that fails. It's either because the expected type is forced in https://github.com/michaelrigart/ansible-role-interfaces/blob/master/filter_plugins/filters.py#L234

ot it's because a type is never set by the bond slave interface template: https://github.com/michaelrigart/ansible-role-interfaces/blob/master/templates/bond_slave_RedHat.j2

@Aethylred
Copy link
Contributor Author

Changing the line https://github.com/michaelrigart/ansible-role-interfaces/blob/master/filter_plugins/filters.py#L234 to

        result = _interface_check(context, slave_interface)

Resolves the issue, but I'm not sure if it's the correct thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant