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:
parent
c1f202efe9
commit
c49b582e2c
@ -18,7 +18,7 @@ galaxy_info:
|
|||||||
description: Installation and setup of glance
|
description: Installation and setup of glance
|
||||||
company: Rackspace
|
company: Rackspace
|
||||||
license: Apache2
|
license: Apache2
|
||||||
min_ansible_version: 2.0
|
min_ansible_version: 2.1
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
@ -23,12 +23,7 @@
|
|||||||
# of venv to be usable by Ansible
|
# of venv to be usable by Ansible
|
||||||
- name: Install testing pip packages
|
- name: Install testing pip packages
|
||||||
pip:
|
pip:
|
||||||
name: "{{ item }}"
|
name: "shade"
|
||||||
with_items:
|
|
||||||
- python-glanceclient
|
|
||||||
- python-keystoneclient
|
|
||||||
- httplib2
|
|
||||||
- pyyaml
|
|
||||||
|
|
||||||
- name: Check the glance-api
|
- name: Check the glance-api
|
||||||
uri:
|
uri:
|
||||||
@ -40,25 +35,26 @@
|
|||||||
url: "http://localhost:9191"
|
url: "http://localhost:9191"
|
||||||
status_code: 401
|
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
|
- name: Upload the Cirros image
|
||||||
glance:
|
os_image:
|
||||||
command: 'image-create'
|
cloud: default
|
||||||
openrc_path: /root/openrc
|
endpoint_type: internal
|
||||||
image_name: cirros
|
validate_certs: "{{ keystone_service_internaluri_insecure | ternary(false, true) }}"
|
||||||
image_url: "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-uec.tar.gz"
|
name: cirros
|
||||||
image_container_format: bare
|
filename: "/var/tmp/cirros.tar.gz"
|
||||||
image_disk_format: qcow2
|
container_format: bare
|
||||||
image_is_public: True
|
disk_format: qcow2
|
||||||
|
is_public: True
|
||||||
register: cirros_image_create
|
register: cirros_image_create
|
||||||
until: cirros_image_create | success
|
until: cirros_image_create | success
|
||||||
retries: 5
|
retries: 5
|
||||||
delay: 15
|
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:
|
vars_files:
|
||||||
- common/test-vars.yml
|
- common/test-vars.yml
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user