Use upstream openstack image module

Replace the use of OSA's glance library with the upstream Ansible
os_image module within this role's functional testing tasks. Also,
httplib2 no longer needs to be installed since it's not needed by the
uri module as of Ansible 2.1.

Change-Id: If0e36c61307056c8786c67b60fd56b03f2ad7bda
This commit is contained in:
Jimmy McCrory 2016-11-10 16:06:48 -08:00
parent c1f202efe9
commit c49b582e2c
2 changed files with 16 additions and 20 deletions

View File

@ -18,7 +18,7 @@ galaxy_info:
description: Installation and setup of glance
company: Rackspace
license: Apache2
min_ansible_version: 2.0
min_ansible_version: 2.1
platforms:
- name: Ubuntu
versions:

View File

@ -23,12 +23,7 @@
# of venv to be usable by Ansible
- name: Install testing pip packages
pip:
name: "{{ item }}"
with_items:
- python-glanceclient
- python-keystoneclient
- httplib2
- pyyaml
name: "shade"
- name: Check the glance-api
uri:
@ -40,25 +35,26 @@
url: "http://localhost:9191"
status_code: 401
- name: Download the Cirros image
get_url:
url: "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-uec.tar.gz"
dest: "/var/tmp/cirros.tar.gz"
- name: Upload the Cirros image
glance:
command: 'image-create'
openrc_path: /root/openrc
image_name: cirros
image_url: "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-uec.tar.gz"
image_container_format: bare
image_disk_format: qcow2
image_is_public: True
os_image:
cloud: default
endpoint_type: internal
validate_certs: "{{ keystone_service_internaluri_insecure | ternary(false, true) }}"
name: cirros
filename: "/var/tmp/cirros.tar.gz"
container_format: bare
disk_format: qcow2
is_public: True
register: cirros_image_create
until: cirros_image_create | success
retries: 5
delay: 15
- name: Ensure image uploaded
fail:
msg: "Image upload failed"
when: (glance_images is not defined) or (glance_images.cirros is not defined) or (glance_images.cirros.id is not defined)
vars_files:
- common/test-vars.yml