diff --git a/defaults/main.yml b/defaults/main.yml index 9eabc154..5b47f778 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -580,6 +580,12 @@ nova_vendor_data_overrides: {} nova_api_metadata_uwsgi_ini_overrides: {} nova_api_os_compute_uwsgi_ini_overrides: {} +# Attempt to auto-discover available vGPU devices. +# It is recommended to define them explicitly through ``nova_enabled_mdev_types``. +# Doing so has precedence over discovered ones and does not require to +# disable the variable explicitly. +nova_discover_mdev_types: true + # Enabled vGPU Types - dict defining 'type' and 'address' (optional) of vGPU # an address is only required when supporting more than one physical GPU on the host # Example 1: diff --git a/tasks/main.yml b/tasks/main.yml index 80aa3a32..03d18490 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -119,8 +119,14 @@ tags: - always -- name: Importing nova_mdev_detect tasks - ansible.builtin.import_tasks: nova_mdev_detect.yml +- name: Including nova_mdev_detect tasks + ansible.builtin.include_tasks: nova_mdev_detect.yml + args: + apply: + tags: + - always + when: + - nova_discover_mdev_types | bool tags: - always