I am having problems removing containers from my docker host after introducing cadvisor - https://github.com/google/cadvisor/issues/771
I have a large number of Ansible (2.2.1.0) scripts that i use to install my service containers on these docker host and internally they are using the docker_container module. Many times these scripts would want to remove a container, but because of the problem stated above, they are failing.
I can force kill docker container on these docker hosts easily:
docker rm container_name -fv
So i would expect that the force_kill option provided in the docker_container module (docker_container module docs) should be able to do the same:
- name: Delete docker containers
docker_container:
name: "container_name"
force_kill: true
keep_volumes: false
state: absent
But the script fail always. I do not know what is the purpose of this option if it is not able to force kill it. All of my scripts are failing even after enabling force_kill and i need to know how to make sure this option works as intended ?
Update: I now understand the force_kill option is sending the docker kill signal. I have updated the question to better reflect what i really want to achieve.