Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker_container kill_signal doesn't accept anymore string with name of signal #505

Closed
earendilfr opened this issue Nov 28, 2022 · 1 comment · Fixed by #506
Closed

docker_container kill_signal doesn't accept anymore string with name of signal #505

earendilfr opened this issue Nov 28, 2022 · 1 comment · Fixed by #506
Labels
bug Something isn't working docker-plain plain Docker (no swarm, no compose, no stack)

Comments

@earendilfr
Copy link

earendilfr commented Nov 28, 2022

SUMMARY

Previously, you can send a signal to the container with the kill_signal parameter and indicate in this parameter the named value of the signal to send (by example, I have it to indicate to a container to reload his configuration by sending a SIGHUP signal.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.docker.docker_container

ANSIBLE VERSION
ansible [core 2.14.0]
  config file = /home/******/*******/ansible/ansible.cfg
  configured module search path = ['/home/*******/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /home//******/*******//ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.8 (main, Nov  1 2022, 14:18:21) [GCC 12.2.0] (/usr/bin/python)
  jinja version = 3.1.2
  libyaml = True

COLLECTION VERSION
# /usr/lib/python3.10/site-packages/ansible_collections
Collection       Version
---------------- -------
community.docker 3.2.1  

CONFIGURATION
CACHE_PLUGIN(/home/*******/*******/ansible/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/home/*******/*******/ansible/ansible.cfg) = /tmp/facts_cache
CACHE_PLUGIN_TIMEOUT(/home/*******/*******/ansible/ansible.cfg) = 7200
COLLECTIONS_PATHS(/home/*******/*******/ansible/ansible.cfg) = ['/home/*******/*******/ansible/collections']
CONFIG_FILE() = /home/*******/*******/ansible/ansible.cfg
DEFAULT_FILTER_PLUGIN_PATH(/home/*******/*******/ansible/ansible.cfg) = ['/home/*******/*******/ansible/filter_plugins']
DEFAULT_GATHERING(/home/*******/*******/ansible/ansible.cfg) = smart
DEFAULT_HOST_LIST(/home/*******/*******/ansible/ansible.cfg) = ['/home/*******/*******/ansible/hosts']
DEFAULT_ROLES_PATH(/home/*******/*******/ansible/ansible.cfg) = ['/home/*******/*******/ansible/roles']
DEFAULT_STDOUT_CALLBACK(/home/*******/*******/ansible/ansible.cfg) = debug
DEFAULT_TIMEOUT(/home/*******/*******/ansible/ansible.cfg) = 120
DEFAULT_VAULT_PASSWORD_FILE(/home/*******/*******/ansible/ansible.cfg) = /home/*******/*******/ansible/.vault_pass
DEPRECATION_WARNINGS(/home/*******/*******/ansible/ansible.cfg) = True
TRANSFORM_INVALID_GROUP_CHARS(/home/*******/*******/ansible/ansible.cfg) = ignore
OS / ENVIRONMENT

Source:

  • Archlinux
    Target:
  • Debian 11
STEPS TO REPRODUCE
---
- name: Test playbook
  hosts: prometheus
  become: true
  gather_facts: true
  serial: 1

  tasks:
    - name: reload prometheus
      docker_container:
        name: prometheus
        state: stopped
        force_kill: True
        kill_signal: "SIGHUP"
EXPECTED RESULTS
ansible-playbook -l prometheus04 -i inventories/test/hosts playbooks/test.yml --diff -K
BECOME password: 

PLAY [Test playbook] ***********************************************************************************************

TASK [reload prometheus] *******************************************************************************************
--- before
+++ after
@@ -1,3 +1,3 @@
 {
-    "running": true
+    "running": false
 }

changed: [prometheus04]

PLAY RECAP *********************************************************************************************************
prometheus04               : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

ACTUAL RESULTS
ansible-playbook -l prometheus04 -i inventories/test/hosts playbooks/test.yml --diff -K
BECOME password: 

PLAY [Test playbook] ***********************************************************************************************

TASK [reload prometheus] *******************************************************************************************
fatal: [prometheus04]: FAILED! => {
    "changed": false
}

MSG:

Error killing container c2b9575247ceab9faa1690026d9fb40979d6cadd2ec2c9746da1851482db5597: invalid literal for int() with base 10: 'SIGHUP'

PLAY RECAP *********************************************************************************************************
prometheus04               : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

@felixfontein felixfontein added bug Something isn't working docker-plain plain Docker (no swarm, no compose, no stack) labels Nov 28, 2022
@felixfontein
Copy link
Collaborator

Thanks for the report! #506 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker-plain plain Docker (no swarm, no compose, no stack)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants