You can use the docker_container module in Ansible. This module is used to create a docker container. I have attached one playbook below for your reference.
- name: Create a docker container
You can also go through the Ansible document for more information.