I am trying to accomplish docker kill -s HUP <container>
in Ansible but it looks like the options I try always restart the container or attempt to instead of reloading the config.
Running the following command allows me to reload the configuration without restarting the container:
docker kill -s HUP <container>
The Ansible docker_container
docs suggest the following options:
force_kill
Use the kill command when stopping a running container.
kill_signal
Override default signal used to kill a running container.
Using the kill_signal
in isolation did nothing.
Below is an example of what I hoped would work:
- name: Reload haproxy config
docker_container:
name: '{{ haproxy_docker_name }}'
state: stopped
image: '{{ haproxy_docker_image }}'
force_kill: True
kill_signal: HUP
I assumed overriding force_kill
and kill_signal
would give me the desired behaviour. I have also tried setting state to 'started' and present
.
What is the correct way to do this?
state: stopped
, but Ansible "restarts the container or attempts to"? Or what is this question about? – Unexceptionable