Updated nova logic to correct issues with addon devices
The logic within the pre_tasks was too loose. The pre_tasks need to have a bit more restrictive conditionals. Additionall the `lxc-device add` command which is being used always exits 0 even when the device add fails. While the task does not have issues with running we should be making sure that our changes are being recoreded correctly. Closes-Bug: 1434945 Change-Id: Icb1707db6bde6c0a26af6bca21a1f88dc3c315a8
This commit is contained in:
parent
2d4f9c750f
commit
a74b076ff0
@ -32,8 +32,14 @@
|
|||||||
for i in /dev/nbd*;do
|
for i in /dev/nbd*;do
|
||||||
lxc-device -n {{ container_name }} add $i $i
|
lxc-device -n {{ container_name }} add $i $i
|
||||||
done
|
done
|
||||||
|
failed_when: false
|
||||||
|
register: device_add
|
||||||
|
changed_when: >
|
||||||
|
'added' in device_add.stdout.lower()
|
||||||
delegate_to: "{{ physical_host }}"
|
delegate_to: "{{ physical_host }}"
|
||||||
when: is_metal == false or is_metal == "False"
|
when: >
|
||||||
|
inventory_hostname in groups['nova_compute'] and
|
||||||
|
(is_metal == false or is_metal == "False")
|
||||||
tags:
|
tags:
|
||||||
- nova-kvm
|
- nova-kvm
|
||||||
- nova-kvm-container-devices
|
- nova-kvm-container-devices
|
||||||
@ -41,7 +47,9 @@
|
|||||||
shell: |
|
shell: |
|
||||||
lxc-device -n {{ container_name }} add /dev/net/tun /dev/net/tun
|
lxc-device -n {{ container_name }} add /dev/net/tun /dev/net/tun
|
||||||
delegate_to: "{{ physical_host }}"
|
delegate_to: "{{ physical_host }}"
|
||||||
when: is_metal == false or is_metal == "False"
|
when: >
|
||||||
|
inventory_hostname in groups['nova_compute'] and
|
||||||
|
(is_metal == false or is_metal == "False")
|
||||||
tags:
|
tags:
|
||||||
- nova-kvm
|
- nova-kvm
|
||||||
- nova-kvm-container-devices
|
- nova-kvm-container-devices
|
||||||
@ -49,7 +57,14 @@
|
|||||||
shell: |
|
shell: |
|
||||||
lxc-device -n {{ container_name }} add /dev/kvm /dev/kvm
|
lxc-device -n {{ container_name }} add /dev/kvm /dev/kvm
|
||||||
delegate_to: "{{ physical_host }}"
|
delegate_to: "{{ physical_host }}"
|
||||||
when: is_metal == false or is_metal == "False"
|
register: device_add
|
||||||
|
failed_when: false
|
||||||
|
changed_when: >
|
||||||
|
'added' in device_add.stdout.lower()
|
||||||
|
when: >
|
||||||
|
inventory_hostname in groups['nova_compute'] and
|
||||||
|
(is_metal == false or is_metal == "False") and
|
||||||
|
nova_virt_type == 'kvm'
|
||||||
tags:
|
tags:
|
||||||
- nova-kvm
|
- nova-kvm
|
||||||
- nova-kvm-container-devices
|
- nova-kvm-container-devices
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- include: nova_compute_kvm.yml
|
- include: nova_compute_kvm.yml
|
||||||
when: nova_virt_type == 'kvm' or nova_virt_type == 'qemu'
|
when: >
|
||||||
|
nova_virt_type == 'kvm' or
|
||||||
|
nova_virt_type == 'qemu'
|
||||||
|
|
||||||
- include: nova_compute_key_create.yml
|
- include: nova_compute_key_create.yml
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user