Allow user defined nova flavor resources

Make use of the Ansible 2 module os_nova_flavor to allow users to define
their own flavors through the ``tempest_flavors`` variable.

Change-Id: I937765975c8ae99c12f8e5705b9aab8e5b115d22
This commit is contained in:
Jimmy McCrory
2016-11-02 16:32:21 -07:00
parent 0d0c6671d9
commit 8c68340a46
4 changed files with 28 additions and 46 deletions

View File

@@ -145,6 +145,7 @@ tempest_requires_pip_packages:
- python-keystoneclient - python-keystoneclient
- python-neutronclient - python-neutronclient
- python-novaclient - python-novaclient
- shade
- virtualenv - virtualenv
- virtualenv-tools - virtualenv-tools
@@ -177,6 +178,18 @@ tempest_img_disk_format: qcow2
tempest_img_name: 'cirros' tempest_img_name: 'cirros'
tempest_enable_instance_password: True tempest_enable_instance_password: True
tempest_flavors:
- name: tempest1
id: 201
ram: 256
disk: 1
vcpus: 1
- name: tempest2
id: 202
ram: 512
disk: 1
vcpus: 1
# This variable is used by the repo_build process to determine # This variable is used by the repo_build process to determine
# which host group to check for members of before building the # which host group to check for members of before building the
# pip packages required by this role. The value is picked up # pip packages required by this role. The value is picked up

View File

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

View File

@@ -0,0 +1,5 @@
---
features:
- A new variable, ``tempest_flavors``, has been added to
the os_tempest role allowing users to define nova flavors
to be during tempest testing.

View File

@@ -251,49 +251,13 @@
insecure: "{{ keystone_service_internaluri_insecure }}" insecure: "{{ keystone_service_internaluri_insecure }}"
when: tempest_service_available_neutron | bool when: tempest_service_available_neutron | bool
- name: Check if tempest flavor 201 exists - name: Create tempest flavors
shell: | os_nova_flavor:
. /root/openrc cloud: default
nova flavor-show tempest1 name: "{{ item.name }}"
register: tempest1 flavorid: "{{ item.id }}"
failed_when: False ram: "{{ item.ram }}"
changed_when: tempest1.rc != 0 disk: "{{ item.disk }}"
vcpus: "{{ item.vcpus }}"
with_items: "{{ tempest_flavors }}"
when: tempest_service_available_nova | bool when: tempest_service_available_nova | bool
tags:
# don't trigger ANSIBLE0013
- skip_ansible_lint
- name: Create tempest flavor 201
shell: |
. /root/openrc
nova flavor-create tempest1 201 256 1 1
when:
- tempest_service_available_nova | bool
- tempest1.rc != 0
tags:
# don't trigger ANSIBLE0013
- skip_ansible_lint
- name: Check if tempest flavor 202 exists
shell: |
. /root/openrc
nova flavor-show tempest2
register: tempest2
failed_when: False
changed_when: tempest2.rc != 0
when: tempest_service_available_nova | bool
tags:
# don't trigger ANSIBLE0013
- skip_ansible_lint
- name: Create tempest flavor 202
shell: |
. /root/openrc
nova flavor-create tempest2 202 512 1 1
when:
- tempest_service_available_nova | bool
- tempest2.rc != 0
tags:
# don't trigger ANSIBLE0013
- skip_ansible_lint