2a5ff43fb8
As requested in this Trello card, this commit adds a nested virtualization flag to the compute metadata by checking /proc/cpuinfo for the hypervisor flag. https://trello.com/c/24QvbT8m/127-check-site-add-a-check-for-kvm-intel-have-nested-1 Change-Id: I7a7dc30ae9bccf7dca2f296f83661899cbe9a96b
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
---
|
|
#
|
|
# Compute Tasks for gathering facts
|
|
#
|
|
- name: Get ovs version
|
|
shell: ovs-vswitchd --version | grep vSwitch | awk {'print$4'}
|
|
register: ovs_version
|
|
|
|
- name: Set ovs version fact
|
|
set_fact:
|
|
openstack_ovs_version: "{{ ovs_version.stdout }}"
|
|
|
|
- name: Get neutron ovs agent ovsdb setting
|
|
shell: crudini --get /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs ovsdb_interface
|
|
register: ovsdb_status
|
|
ignore_errors: true
|
|
|
|
- name: Set Neutron OVS ovsdb fact
|
|
set_fact:
|
|
openstack_neutron_ovsdb: "{{ ovsdb_status.stdout }}"
|
|
when: (ovsdb_status.stdout.find('native') != -1 or ovsdb_status.stdout.find('vsctl') != -1)
|
|
|
|
- name: Set Neutron OVS ovsdb fact
|
|
set_fact:
|
|
openstack_neutron_ovsdb: "vsctl"
|
|
when: (ovsdb_status.stdout.find('native') == -1 and ovsdb_status.stdout.find('vsctl') == -1)
|
|
|
|
|
|
- name: Check for Nested Virtualization
|
|
shell: cat /proc/cpuinfo | grep hypervisor
|
|
register: nested_virt
|
|
ignore_errors: true
|
|
|
|
- name: Set Nested Virtualization flag
|
|
set_fact:
|
|
openstack_nested_virt: true
|
|
when: nested_virt.stdout != ""
|
|
|
|
- name: Set Nested Virtualization flag
|
|
set_fact:
|
|
openstack_nested_virt: false
|
|
when: nested_virt.stdout == ""
|