ansible-collections / community.zabbix

Zabbix Ansible modules
http://galaxy.ansible.com/community/zabbix
Other
320 stars 276 forks source link

problem with mitogen #1092

Closed dberardo-com closed 12 months ago

dberardo-com commented 12 months ago

i am trying trying to create new host_groups using this collection (with an older version it used to work without any trouble), and i am doing this:

    - name: "API | Create host groups"
      vars: &connection
        ansible_network_os: community.zabbix.zabbix
        ansible_connection: httpapi
        ansible_host: "{{ zabbix_api_server_url }}"
        ansible_httpapi_validate_certs: "{{ zabbix_api_validate_certs|default(omit) }}"
        ansible_user: "{{ zabbix_api_http_user | default(zabbix_http_user | default(omit)) }}"
        ansible_httpapi_pass: "{{ zabbix_api_http_password | default(zabbix_http_password | default(omit)) }}"
      zabbix_group:
        host_group: "{{ zabbix_host_groups }}"
        state: "{{ zabbix_agent_hostgroups_state }}"
      delegate_to: localhost

i am using mitogen with ansible (because without ... well it just sucks :D ) and i get this error:

AttributeError: 'get_with_context_result' object has no attribute '_create_control_path'

i guess it might be related to the fact the one ansible plugin is loaded in a task ? is it possible to authenticate the zabbix API without using this plugin, like it used to work in the past, with simple username and password as task arguments ?

thanks

dberardo-com commented 12 months ago

i can confirm that executing the same play with the "linear" strategy does not lead to any error

pyrodie18 commented 12 months ago

Unfortunately with the move to 2.0, we deprecated support for using the Python library as a connection method and moved over exclusively to HTTPapi. The collection is developed around pure Ansible and does not test or take into consideration its use with mitogen.

dberardo-com commented 12 months ago

i see, thats a bit of a "downgrade" IMO .. is this an issue to be opened up in the ansible httpapi repo ?