Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/libvirt_manager/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ cifmw_libvirt_manager_firewalld_zone_libvirt_forward: true
cifmw_libvirt_manager_firewalld_default_zone: public
cifmw_libvirt_manager_firewalld_default_zone_masquerade: true
cifmw_libvirt_manager_attach_dummy_interface_on_bridges: true
cifmw_libvirt_manager_predictable_nic_names: false
cifmw_libvirt_manager_extra_network_configuration: {}

cifmw_libvirt_manager_vm_users: []
Expand Down
8 changes: 8 additions & 0 deletions roles/libvirt_manager/tasks/create_vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
xml: "{{ lookup('template', cifmw_libvirt_manager_vm_template) }}"
uri: "qemu:///system"

- name: "Disable net.ifnames=0 for {{ vm }}"
when:
- vm_data.disk_file_name != 'blank'
- cifmw_libvirt_manager_predictable_nic_names | default(false) | bool
- vm is match('^.*(compute).*$')
ansible.builtin.command:
cmd: "virt-customize -c qemu:///system --domain cifmw-{{ vm }} --run-command 'grubby --remove-args=net.ifnames=0 --update-kernel=ALL'"

- name: "Attach listed networks to the VMs {{ vm }}"
vars:
vm_item: "{{ vm }}"
Expand Down
Loading