michaelrigart / ansible-role-interfaces

An ansible role for configuring different network interfaces
GNU General Public License v3.0
83 stars 61 forks source link

Failure while running "Bounce network devices" handler #82

Closed priteau closed 3 years ago

priteau commented 3 years ago

Recent releases 1.7.0 and 1.8.0 of this role are broken when no Ethernet interface is being configured:

RUNNING HANDLER [MichaelRigart.interfaces : Bounce network devices] ************
task path: /home/zuul/kayobe-venv/share/kayobe/ansible/roles/MichaelRigart.interfaces/handlers/main.yml:110
fatal: [controller0]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: 'ether_interfaces_changed' is undefined\n\nThe error appears to be in '/home/zuul/kayobe-venv/share/kayobe/ansible/roles/MichaelRigart.interfaces/handlers/main.yml': line 110, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Bounce network devices\n  ^ here\n"
}

I believe this was caused by https://github.com/michaelrigart/ansible-role-interfaces/pull/79: when interfaces_ether_interfaces is empty, ethernet_configuration.yml isn't included anymore, resulting in an undefined variable.

The same issue probably happens when interfaces_bond_interfaces or interfaces_bridge_interfaces is empty.