From c49b582e2cdc0f91d5dbde9c0b795d76e2b58e7d Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Thu, 10 Nov 2016 16:06:48 -0800 Subject: [PATCH] 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 --- meta/main.yml | 2 +- tests/test-glance-functional.yml | 34 ++++++++++++++------------------ 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index f917a3f7..0468e442 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -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: diff --git a/tests/test-glance-functional.yml b/tests/test-glance-functional.yml index 1c392470..11330361 100644 --- a/tests/test-glance-functional.yml +++ b/tests/test-glance-functional.yml @@ -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