Install testing packages when testing

We need libvirt, qemu, etc, when testing is true.

Also work around Ubuntu issue with sgabios.bin location if we
need to.
This commit is contained in:
David Shrewsbury 2015-03-12 11:01:42 -04:00
parent f2b6e474c5
commit 1456464286
2 changed files with 19 additions and 1 deletions

View File

@ -12,6 +12,14 @@
with_items:
- pxelinux
when: ansible_distribution_version|version_compare('14.10', '>=')
- name: "Install testing packages"
local_action: apt name={{ item }}
with_items:
- libvirt-bin
- qemu-utils
- qemu-kvm
- sgabios
when: testing == true
- name: "Ensuring /opt/stack is present"
local_action: file name=/opt/stack state=directory owner=root group=root
# This won't be necessary in the long run, however until a suitable version
@ -175,6 +183,17 @@
- name: "Enabling IP forwarding in sysctl"
local_action: sysctl name="net.ipv4.ip_forward" value=1 sysctl_set=yes state=present reload=yes
when: testing == true
# NOTE(Shrews) Ubuntu packaging+apparmor issue prevents libvirt from loading
# the ROM from /usr/share/misc.
- name: "Looking for sgabios in /usr/share/qemu"
local_action: stat path=/usr/share/qemu/sgabios.bin
register: test_sgabios_qemu
- name: "Looking for sgabios in /usr/share/misc"
local_action: stat path=/usr/share/misc/sgabios.bin
register: test_sgabios_misc
- name: "Place sgabios.bin"
local_action: command cp /usr/share/misc/sgabios.bin /usr/share/qemu/sgabios.bin
when: test_sgabios_qemu == false and test_sgabios_misc == true and testing == true
- name: "Deploying nginx configuration file for serving HTTP requests"
local_action: template src=nginx.conf.j2 dest=/etc/nginx/nginx.conf

View File

@ -23,7 +23,6 @@ required_packages_ubuntu:
- nginx
- wget
- genisoimage
- qemu-utils
- kpartx
http_boot_folder: /httpboot
transform_boot_image: false