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

empty bridged network fails with: 'nic_name' is undefined #406

Open
andreaskaris opened this issue May 25, 2021 · 0 comments
Open

empty bridged network fails with: 'nic_name' is undefined #406

andreaskaris opened this issue May 25, 2021 · 0 comments

Comments

@andreaskaris
Copy link

fatal: [hypervisor]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'nic_name' is undefined\n\nThe error appears to be in '/home/infrared/.infrared/plugins/virsh/tasks/bridged_network.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# https://jamielinux.com/docs/libvirt-networking-handbook/bridged-network.html#bridged-network\n- name: validate required nic is present\n  ^ here\n"}

- name: create bridged network

    - name: create bridged network
      include_tasks: tasks/bridged_network.yml
      vars:
          nic_settings: "{{ item }}"
          nic_data: "{{ (item.nic == '') | ternary(hostvars[inventory_hostname]['ansible_' + ansible_default_ipv4.interface],
              hostvars[inventory_hostname]['ansible_' + item.nic]|default('')) }}"
      with_items:
          "{{ networks.values() | selectattr('forward', 'defined') | selectattr('forward', 'equalto', 'bridge') | list }}"
      when: "networks is defined"

msg: "Cannot find bridge nic: {{ nic_name }}"

- name: validate required nic is present
  fail:
      msg: "Cannot find bridge nic: {{ nic_name }}"
  when: nic_data == ''
andreaskaris added a commit to andreaskaris/infrared that referenced this issue May 25, 2021
The error message contained a reference to invalid variable
nic_name. This commit fixes this and provides a clue to what
might have gone wrong.

Closes issue redhat-openstack#406

Signed-off-by: Andreas Karis <ak.karis@gmail.com>
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