Skip to content

Commit

Permalink
ensure the nested virtualizations files exists (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
kobihk authored and lukas-bednar committed Jan 10, 2019
1 parent 19f2a9e commit faeec67
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,25 @@
msg: "The system doesn't seem to have Intel nor AMD virtualization support."
when: intel_proccesor.rc != 0 and amd_proccesor != 0

- name: Set facts for Intel virtualization
- name: Set fact for Intel virtualization
set_fact:
nested_virtualization_test_path: "/sys/module/kvm_intel/parameters/nested"
nested_virtualization_module_name: "kvm_intel"
when: intel_proccesor.rc == 0

- name: Set facts for AMD virtualization
- name: Set fact for AMD virtualization
set_fact:
nested_virtualization_test_path: "/sys/module/kvm_amd/parameters/nested"
nested_virtualization_module_name: "kvm_amd"
when: amd_proccesor.rc == 0

- name: Set fact for nested virtualization test path
set_fact:
nested_virtualization_test_path: "/sys/module/{{ nested_virtualization_module_name }}/parameters/nested"

- name: "Ensure {{ nested_virtualization_module_name }} module is available and loaded"
modprobe:
name: "{{ nested_virtualization_module_name }}"
state: present

- name: Test status of nested virtualization
shell: |
set -e
Expand Down

0 comments on commit faeec67

Please sign in to comment.