{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/42617","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/42617/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/42617/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/42617/events","html_url":"https://github.com/ansible/ansible/issues/42617","id":340186244,"node_id":"MDU6SXNzdWUzNDAxODYyNDQ=","number":42617,"title":"zabbix_host module error: \"'>=' not supported between instances of 'str' and 'int'\"","user":{"login":"habalux","id":5422592,"node_id":"MDQ6VXNlcjU0MjI1OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/5422592?v=4","gravatar_id":"","url":"https://api.github.com/users/habalux","html_url":"https://github.com/habalux","followers_url":"https://api.github.com/users/habalux/followers","following_url":"https://api.github.com/users/habalux/following{/other_user}","gists_url":"https://api.github.com/users/habalux/gists{/gist_id}","starred_url":"https://api.github.com/users/habalux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habalux/subscriptions","organizations_url":"https://api.github.com/users/habalux/orgs","repos_url":"https://api.github.com/users/habalux/repos","events_url":"https://api.github.com/users/habalux/events{/privacy}","received_events_url":"https://api.github.com/users/habalux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-11T10:37:53Z","updated_at":"2018-07-11T10:46:21Z","closed_at":null,"author_association":"NONE","body":"<!---\r\nVerify first that your issue/request is not already reported on GitHub.\r\nTHIS FORM WILL BE READ BY A MACHINE, COMPLETE ALL SECTIONS AS DESCRIBED.\r\nAlso test if the latest release, and devel branch are affected too.\r\nALWAYS add information AFTER (OUTSIDE) these html comments.\r\nOtherwise it may end up being automatically closed by our bot. -->\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\nzabbix_host module raises error when updating configuration values:\r\n```\r\nFailed to update host test1: \"'>=' not supported between instances of 'str' and 'int'\"\r\n```\r\nError does not occur when first creating zabbix host, or when there are no changes to apply.\r\n\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!--- Insert, BELOW THIS COMMENT, the name of the module, plugin, task or feature.\r\nDo not include extra details here, e.g. \"vyos_command\" not \"the network module vyos_command\" or the full path-->\r\nzabbix_host\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste, BELOW THIS COMMENT, verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\nansible 2.6.1\r\n  config file = /home/xxx/ansible/ansible_base/ansible.cfg\r\n  configured module search path = ['/home/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /home/xxx/ansible/aenv/lib/python3.6/site-packages/ansible\r\n  executable location = /home/xxx/ansible/aenv/bin/ansible\r\n  python version = 3.6.5 (default, Apr  1 2018, 05:46:30) [GCC 7.3.0]\r\n```\r\n\r\n##### CONFIGURATION\r\n<!--- If using Ansible 2.4 or above, paste, BELOW THIS COMMENT, the results of \"ansible-config dump --only-changed\"\r\nOtherwise, mention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).-->\r\nDEFAULT_HOST_LIST(/home/xxx/ansible/ansible_base/ansible.cfg) = ['/home/xxx/ansible/ansible_base/hosts.yaml']\r\nDEFAULT_PRIVATE_KEY_FILE(/home/xxx/ansible/ansible_base/ansible.cfg) = /home/xxx/ansible/ansible_base/ansible_rsa\r\nDEFAULT_ROLES_PATH(/home/xxx/ansible/ansible_base/ansible.cfg) = ['/home/xxx/ansible/ansible_base/roles', '/home/xxx/ansible/ansible_base/roles_galaxy', '/home/xxx/ansible/ansible_base/roles_external']\r\n\r\n##### OS / ENVIRONMENT\r\n<!--- Mention, BELOW THIS COMMENT, the OS you are running Ansible from, and the OS you are\r\nmanaging, or say \"N/A\" for anything that is not platform-specific.\r\nAlso mention the specific version of what you are trying to control,\r\ne.g. if this is a network bug the version of firmware on the network device.-->\r\nOS: Ubuntu 18.04 64-bit\r\nPython version: 3.6.5\r\nzabbix-api version: 0.5.3\r\nZabbix server: Zabbix 3.4.11 (fresh install)\r\n\r\n##### STEPS TO REPRODUCE\r\n<!--- For bugs, show exactly how to reproduce the problem, using a minimal test-case.\r\nFor new features, show how the feature would be used. -->\r\nTry to use the zabbix_host module to reconfigure a host in zabbix, changing or adding the host_group for example.\r\n\r\nTest playbook:\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```yaml\r\n- hosts: test1\r\n  tasks:\r\n    - name: Test zabbix\r\n      local_action:\r\n        module: zabbix_host\r\n        server_url: \"http://192.168.xxx.yyy/zabbix\"\r\n        login_user: \"Admin\"\r\n        login_password: \"zabbix\"\r\n        host_name: \"{{ inventory_hostname }}\"\r\n        host_groups:\r\n          - \"Linux servers\"\r\n          - \"Virtual machines\"\r\n        link_templates:\r\n          - \"Template OS Linux\"\r\n        status: enabled\r\n        state: present\r\n        interfaces:\r\n          - type: 1\r\n            main: 1\r\n            useip: 1\r\n            ip: \"{{ ansible_default_ipv4.address }}\"\r\n```\r\n\r\nInventory file:\r\n```yaml\r\nall:\r\n  hosts:\r\n    test1:\r\n      ansible_connection: local\r\n    test2:\r\n    test3:\r\n  vars:\r\n    ansible_ssh_user: root\r\n\r\npy3_hosts:\r\n  hosts:\r\n    test1:\r\n    test2:\r\n    test3:\r\n  vars:\r\n    ansible_python_interpreter: \"/usr/bin/python3\"\r\n```\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\n<!--- What did you expect to happen when running the steps above? -->\r\nZabbix host configuration would get updated without error\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\nPlaybook run stops with the error message:\r\n```Failed to update host test1: '>=' not supported between instances of 'str' and 'int'```\r\n\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\n(aenv) xxx@test1:~/ansible/ansible_base$ ansible-playbook zabbixtest.yml -vvv\r\nansible-playbook 2.6.1\r\n  config file = /home/xxx/ansible/ansible_base/ansible.cfg\r\n  configured module search path = ['/home/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /home/xxx/ansible/aenv/lib/python3.6/site-packages/ansible\r\n  executable location = /home/xxx/ansible/aenv/bin/ansible-playbook\r\n  python version = 3.6.5 (default, Apr  1 2018, 05:46:30) [GCC 7.3.0]\r\nUsing /home/xxx/ansible/ansible_base/ansible.cfg as config file\r\nParsed /home/xxx/ansible/ansible_base/hosts.yaml inventory source with yaml plugin\r\n\r\nPLAYBOOK: zabbixtest.yml *******************************************************************************************************************************************************************************************************\r\n1 plays in zabbixtest.yml\r\n\r\nPLAY [test1] *******************************************************************************************************************************************************************************************************************\r\n\r\nTASK [Gathering Facts] *********************************************************************************************************************************************************************************************************\r\ntask path: /home/xxx/ansible/ansible_base/zabbixtest.yml:1\r\n<test1> ESTABLISH LOCAL CONNECTION FOR USER: xxx\r\n<test1> EXEC /bin/sh -c 'echo ~xxx && sleep 0'\r\n<test1> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo /home/xxx/.ansible/tmp/ansible-tmp-1531301389.2208893-280135625108506 `\" && echo ansible-tmp-1531301389.2208893-280135625108506=\"` echo /home/xxx/.ansible/tmp/ansible-tmp-1531301389.2208893-280135625108506 `\" ) && sleep 0'\r\nUsing module file /home/xxx/ansible/aenv/lib/python3.6/site-packages/ansible/modules/system/setup.py\r\n<test1> PUT /home/xxx/.ansible/tmp/ansible-local-127604ksuyjx10/tmpp3apd4uw TO /home/xxx/.ansible/tmp/ansible-tmp-1531301389.2208893-280135625108506/setup.py\r\n<test1> EXEC /bin/sh -c 'chmod u+x /home/xxx/.ansible/tmp/ansible-tmp-1531301389.2208893-280135625108506/ /home/xxx/.ansible/tmp/ansible-tmp-1531301389.2208893-280135625108506/setup.py && sleep 0'\r\n<test1> EXEC /bin/sh -c '/usr/bin/python3 /home/xxx/.ansible/tmp/ansible-tmp-1531301389.2208893-280135625108506/setup.py && sleep 0'\r\n<test1> EXEC /bin/sh -c 'rm -f -r /home/xxx/.ansible/tmp/ansible-tmp-1531301389.2208893-280135625108506/ > /dev/null 2>&1 && sleep 0'\r\nok: [test1]\r\nMETA: ran handlers\r\n\r\nTASK [Test zabbix] *************************************************************************************************************************************************************************************************************\r\ntask path: /home/xxx/ansible/ansible_base/zabbixtest.yml:3\r\n<localhost> ESTABLISH LOCAL CONNECTION FOR USER: xxx\r\n<localhost> EXEC /bin/sh -c 'echo ~xxx && sleep 0'\r\n<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo /home/xxx/.ansible/tmp/ansible-tmp-1531301390.0268269-190133495246230 `\" && echo ansible-tmp-1531301390.0268269-190133495246230=\"` echo /home/xxx/.ansible/tmp/ansible-tmp-1531301390.0268269-190133495246230 `\" ) && sleep 0'\r\nUsing module file /home/xxx/ansible/aenv/lib/python3.6/site-packages/ansible/modules/monitoring/zabbix/zabbix_host.py\r\n<localhost> PUT /home/xxx/.ansible/tmp/ansible-local-127604ksuyjx10/tmp_eebd3om TO /home/xxx/.ansible/tmp/ansible-tmp-1531301390.0268269-190133495246230/zabbix_host.py\r\n<localhost> EXEC /bin/sh -c 'chmod u+x /home/xxx/.ansible/tmp/ansible-tmp-1531301390.0268269-190133495246230/ /home/xxx/.ansible/tmp/ansible-tmp-1531301390.0268269-190133495246230/zabbix_host.py && sleep 0'\r\n<localhost> EXEC /bin/sh -c '/home/xxx/ansible/aenv/bin/python3 /home/xxx/.ansible/tmp/ansible-tmp-1531301390.0268269-190133495246230/zabbix_host.py && sleep 0'\r\n<localhost> EXEC /bin/sh -c 'rm -f -r /home/xxx/.ansible/tmp/ansible-tmp-1531301390.0268269-190133495246230/ > /dev/null 2>&1 && sleep 0'\r\nThe full traceback is:\r\n  File \"/tmp/ansible_vu_o28t_/ansible_module_********_host.py\", line 324, in update_host\r\n    if proxy_id >= 0:\r\n\r\nfatal: [test1 -> localhost]: FAILED! => {\r\n    \"changed\": false,\r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"description\": null,\r\n            \"force\": true,\r\n            \"host_groups\": [\r\n                \"Linux servers\",\r\n                \"Virtual machines\"\r\n            ],\r\n            \"host_name\": \"test1\",\r\n            \"http_login_password\": null,\r\n            \"http_login_user\": null,\r\n            \"interfaces\": [\r\n                {\r\n                    \"dns\": \"\",\r\n                    \"ip\": \"192.168.xxx.yyy\",\r\n                    \"main\": 1,\r\n                    \"port\": \"10050\",\r\n                    \"type\": 1,\r\n                    \"useip\": 1\r\n                }\r\n            ],\r\n            \"inventory_mode\": null,\r\n            \"inventory_zabbix\": null,\r\n            \"ipmi_authtype\": null,\r\n            \"ipmi_password\": null,\r\n            \"ipmi_privilege\": null,\r\n            \"ipmi_username\": null,\r\n            \"link_templates\": [\r\n                \"Template OS Linux\"\r\n            ],\r\n            \"login_password\": \"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER\",\r\n            \"login_user\": \"Admin\",\r\n            \"proxy\": null,\r\n            \"server_url\": \"http://192.168.xxx.zzz/********\",\r\n            \"state\": \"present\",\r\n            \"status\": \"enabled\",\r\n            \"timeout\": 10,\r\n            \"tls_accept\": 1,\r\n            \"tls_connect\": 1,\r\n            \"tls_issuer\": null,\r\n            \"tls_psk\": null,\r\n            \"tls_psk_identity\": null,\r\n            \"tls_subject\": null,\r\n            \"validate_certs\": true,\r\n            \"visible_name\": null\r\n        }\r\n    },\r\n    \"msg\": \"Failed to update host test1: '>=' not supported between instances of 'str' and 'int'\"\r\n}\r\n        to retry, use: --limit @/home/xxx/ansible/ansible_base/zabbixtest.retry\r\n\r\nPLAY RECAP *********************************************************************************************************************************************************************************************************************\r\ntest1                      : ok=1    changed=0    unreachable=0    failed=1\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/404126408","html_url":"https://github.com/ansible/ansible/issues/42617#issuecomment-404126408","issue_url":"https://api.github.com/repos/ansible/ansible/issues/42617","id":404126408,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDEyNjQwOA==","user":{"login":"ansibot","id":6585283,"node_id":"MDQ6VXNlcjY1ODUyODM=","avatar_url":"https://avatars0.githubusercontent.com/u/6585283?v=4","gravatar_id":"","url":"https://api.github.com/users/ansibot","html_url":"https://github.com/ansibot","followers_url":"https://api.github.com/users/ansibot/followers","following_url":"https://api.github.com/users/ansibot/following{/other_user}","gists_url":"https://api.github.com/users/ansibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ansibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansibot/subscriptions","organizations_url":"https://api.github.com/users/ansibot/orgs","repos_url":"https://api.github.com/users/ansibot/repos","events_url":"https://api.github.com/users/ansibot/events{/privacy}","received_events_url":"https://api.github.com/users/ansibot/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T10:46:21Z","updated_at":"2018-07-11T10:46:21Z","author_association":"CONTRIBUTOR","body":"cc @D3DeFi @cove @eikef @harrisongu\n[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)\n<!--- boilerplate: notify --->"}}
{"actor":{"display_login":"ansibot"}}