I am using the Ansible Docker module and trying to run docker with the "--rm" flag set. However, I do not see an option for specifying to use the "--rm" flag or a way to pass in which Docker flags to set on the Ansible Docker Module.
Is there a way to set the "--rm" flag when starting a container with the Ansible Docker module?
Thanks
The Docker module linked by OP is deprecated and @Lexandro's answer is outdated.
This is now supported in the newer module named docker_container as the auto_remove feature (added in 2.4)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With