mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-07-26 17:54:28 +00:00
34 lines
1.0 KiB
YAML
34 lines
1.0 KiB
YAML
---
|
|
- name: List flavors
|
|
openstack.cloud.compute_flavor_info:
|
|
cloud: "{{ cloud }}"
|
|
|
|
- name: List flavors with filter
|
|
openstack.cloud.compute_flavor_info:
|
|
cloud: "{{ cloud }}"
|
|
name: "m1.tiny"
|
|
register: flavor_name
|
|
|
|
- name: Check output of list flavors with filter
|
|
assert:
|
|
that:
|
|
- flavor_name.openstack_flavors | length == 1
|
|
|
|
- name: Assert fields on SDK 0.*
|
|
when: sdk_version is version(1.0, '<')
|
|
assert:
|
|
that:
|
|
- '["name", "description", "disk", "is_public", "ram",
|
|
"vcpus", "swap", "ephemeral", "is_disabled", "rxtx_factor", "id",
|
|
"extra_specs"] | difference(flavor_name.openstack_flavors.0.keys())
|
|
| length == 0'
|
|
|
|
- name: Assert fields on SDK 1.*
|
|
when: sdk_version is version(1.0, '>=')
|
|
assert:
|
|
that:
|
|
- '["name", "original_name", "description", "disk", "is_public", "ram",
|
|
"vcpus", "swap", "ephemeral", "is_disabled", "rxtx_factor", "id",
|
|
"extra_specs"] | difference(flavor_name.openstack_flavors.0.keys())
|
|
| length == 0'
|