How does one set up OpenStack Swift (object) storage container-specific API keys with Ansible?

HOW TO -️ October 18, 2021

I've got the following OpenStack commands for setting up Swift object storage containers:

ERROR Rendering Code Block

I'd like to convert them to Ansible so they can be run as part of a role.

For the first command, I know I can use the os_object module for creating the container, but it doesn't appear to provide a parameter for setting a property, which in this case is for setting up key access to the container. (It's based on the documentation at Container Specific API Keys.)

So how would I execute the second command within Ansible natively, without resorting to running the shell command directly?

Answer

I created an issue for this at Allow os\_object to set container properties.

Initializing...