mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-07 13:53:15 +00:00
Update project_info module to new sdk
Make project_info module compatible with the new sdk 1.0.0 and also add ansible tests for project_info module Change-Id: I413200cf6a9b8bada7e5d78087246b888d53fac2
This commit is contained in:
46
ci/roles/project_info/tasks/main.yml
Normal file
46
ci/roles/project_info/tasks/main.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
- name: List admin project
|
||||
openstack.cloud.project_info:
|
||||
cloud: "{{ cloud }}"
|
||||
name: 'admin'
|
||||
register: project_admin
|
||||
|
||||
- name: List admin project with filter
|
||||
openstack.cloud.project_info:
|
||||
cloud: "{{ cloud }}"
|
||||
filters:
|
||||
name: 'admin'
|
||||
|
||||
- name: Check output of list admin project
|
||||
assert:
|
||||
that:
|
||||
- project_admin.openstack_projects | length == 1
|
||||
|
||||
- name: List all projects
|
||||
openstack.cloud.project_info:
|
||||
cloud: "{{ cloud }}"
|
||||
register: all_projects
|
||||
|
||||
- name: Check output of list all projects
|
||||
assert:
|
||||
that:
|
||||
- all_projects.openstack_projects | length > 0
|
||||
|
||||
- name: List admin project with domain
|
||||
openstack.cloud.project_info:
|
||||
cloud: "{{ cloud }}"
|
||||
name: 'admin'
|
||||
domain: 'default'
|
||||
register: project_domain
|
||||
|
||||
- name: Check output of list admin project with admin domain
|
||||
assert:
|
||||
that:
|
||||
- project_domain.openstack_projects | length == 1
|
||||
|
||||
- name: Assert fields on SDK 1.*
|
||||
assert:
|
||||
that:
|
||||
- '["description", "domain_id", "is_domain", "is_enabled", "options",
|
||||
"parent_id", "id", "name", "tags"] |
|
||||
difference(project_admin.openstack_projects.0.keys()) | length == 0'
|
||||
@@ -52,6 +52,7 @@
|
||||
- { role: object, tags: object }
|
||||
- { role: port, tags: port }
|
||||
- { role: project, tags: project }
|
||||
- { role: project_info, tags: project_info }
|
||||
- { role: recordset, tags: recordset }
|
||||
- { role: role_assignment, tags: role_assignment }
|
||||
- { role: router, tags: router }
|
||||
|
||||
Reference in New Issue
Block a user