mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-06 05:13:01 +00:00
Previously both modules object and object_container had huge overlaps in functionality. Both allowed to create and delete containers. One would not have to pass a object to the object module at all and could use it to manage containers only. Now the object module has been changed to manage an object in a container only while the object_container module is responsible for managing Swift containers only. With object module it is now also possible to pass data instead of a filename via module options. The container_access functionality has been dropped from object module. It has been moved and extended as read_ACL and write_ACL options in object_container module. With object_container module it is now also possible to manage the container access with read_ACL and write_ACL options. Those mirror earlier container_access option of the object module which has been removed. Change-Id: I96fb9b946444866b157655e148250f1eda35e942
36 lines
878 B
YAML
36 lines
878 B
YAML
---
|
|
- name: Create container
|
|
openstack.cloud.object_container:
|
|
cloud: "{{ cloud }}"
|
|
state: present
|
|
name: ansible_container
|
|
|
|
- name: Create object
|
|
openstack.cloud.object:
|
|
cloud: "{{ cloud }}"
|
|
state: present
|
|
name: ansible_object
|
|
data: "this is a test"
|
|
container: ansible_container
|
|
register: object
|
|
|
|
- name: Assert return values of object module
|
|
assert:
|
|
that:
|
|
- object.object.id == "ansible_object"
|
|
# allow new fields to be introduced but prevent fields from being removed
|
|
- expected_fields|difference(object.object.keys())|length == 0
|
|
|
|
- name: Delete object
|
|
openstack.cloud.object:
|
|
cloud: "{{ cloud }}"
|
|
state: absent
|
|
name: ansible_object
|
|
container: ansible_container
|
|
|
|
- name: Delete container
|
|
openstack.cloud.object_container:
|
|
cloud: "{{ cloud }}"
|
|
state: absent
|
|
name: ansible_container
|