dj-wasabi / ansible-zabbix-agent

Installing and maintaining zabbix-agent for RedHat/Debian/Ubuntu/Windows/Suse.
https://galaxy.ansible.com/dj-wasabi/zabbix-agent
MIT License
327 stars 249 forks source link

Create/update host fail since the addition of ipmi variable #317

Closed But4ler closed 4 years ago

But4ler commented 4 years ago

Describe the bug Create host fail since the addition of ipmi

We needed a fix present in the master but not in the last tag. So this problem breaks our CI/CD chain via AWX, AWX reloads the role version on master branch every time.

Thanks :)

Installation method/version ansible-galaxy netaddr (0.7.19) zabbix-api (0.5.4)

Example:

Ansible Version 2.8.5

<!--- Paste output from "ansible --version" -->

Targetted hosts

Expected behavior

fatal: [cloud-dhcp-******** -> localhost]: FAILED! => {"attempts": 3, "changed": false, "msg": "argument ipmi_authtype is of type <class 'str'> and we were unable to convert to int: <class 'str'> cannot be converted to an int"}`

Additional context

{
    "msg": "argument ipmi_authtype is of type <class 'str'> and we were unable to convert to int: <class 'str'> cannot be converted to an int",
    "invocation": {
        "module_args": {
            "server_url": "http://cloud-zabbix-******:8080/",
            "login_user": " * ***** ",
            "login_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "host_name": "cloud-dhcp-******",
            "host_groups": [
                "Admin"
            ],
            "link_templates": [
                "Template OS Linux"
            ],
            "status": "enabled",
            "state": "present",
            "force": true,
            "proxy": "cloud-zabbixpx-******",
            "inventory_mode": "disabled",
            "interfaces": [
                {
                    "type": 1,
                    "main": 1,
                    "useip": 1,
                    "ip": "10.*.*.*",
                    "dns": "cloud-dhcp*****",
                    "port": 10050
                }
            ],
            "visible_name": "cloud-dhcp*****",
            "tls_psk_identity": "",
            "tls_issuer": "",
            "tls_subject": "",
            "tls_accept": "1",
            "tls_connect": "1",
            "description": "",
            "inventory_zabbix": "",
            "ipmi_authtype": "",
            "ipmi_password": "",
            "ipmi_privilege": "",
            "ipmi_username": "",
            "ca_cert": "",
            "validate_certs": true,
            "timeout": 10
        }
    },
    "_ansible_no_log": false,
    "attempts": 3,
    "changed": false,
    "_ansible_delegated_vars": {
        "ansible_host": "localhost"
    }
}
tobiasehlert commented 4 years ago

Created PR for this to get fixed: https://github.com/dj-wasabi/ansible-zabbix-agent/pull/319

tobiasehlert commented 4 years ago

PR https://github.com/dj-wasabi/ansible-zabbix-agent/pull/319 has been merged. Please check if this fixed your issue and if so, close your issue 😃

But4ler commented 4 years ago

Hi it's not completly good for me, now we have this error

"msg": "argument inventory_zabbix is of type <class 'str'> and we were unable to convert to dict: dictionary requested, could not parse JSON or key=value"
fatal: [cloud-dhcp***** -> localhost]: FAILED! => {
    "attempts": 3,
    "changed": false,
    "invocation": {
        "module_args": {
            "ca_cert": "",
            "description": "",
            "force": true,
            "host_groups": [
                "Admin"
            ],
            "host_name": "cloud-dhcp*****",
            "interfaces": [
                {
                    "dns": "cloud-dhcp*****",
                    "ip": "10.*.*.*",
                    "main": 1,
                    "port": 10050,
                    "type": 1,
                    "useip": 1
                }
            ],
            "inventory_mode": "disabled",
            "inventory_zabbix": "",
            "ipmi_authtype": 2,
            "ipmi_password": "",
            "ipmi_privilege": 2,
            "ipmi_username": "",
            "link_templates": [
                "Template OS Linux"
            ],
            "login_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "login_user": "******",
            "proxy": "cloud-zabbixpx******",
            "server_url": "http://cloud-zabbix-*****:8080/",
            "state": "present",
            "status": "enabled",
            "timeout": 10,
            "tls_accept": 1,
            "tls_connect": 1,
            "tls_issuer": "",
            "tls_psk_identity": "",
            "tls_subject": "",
            "validate_certs": true,
            "visible_name": "cloud-dhcp70-***"
        }
    },
    "msg": "argument inventory_zabbix is of type <class 'str'> and we were unable to convert to dict: dictionary requested, could not parse JSON or key=value"
}

https://docs.ansible.com/ansible/latest/modules/zabbix_host_module.html#parameter-inventory_zabbix

With zabbix_agent_inventory_zabbix: {} on default value, it's ok I don't measure every impact for push one PR sorry

Thanks ! :)

tobiasehlert commented 4 years ago

This is not related to the issue you reported before, so would have been best to create a separate issue for that. But lets not be that square 😄

Created PR for this to get fixed: https://github.com/dj-wasabi/ansible-zabbix-agent/pull/323

tobiasehlert commented 4 years ago

@But4ler, the PR https://github.com/dj-wasabi/ansible-zabbix-agent/pull/323 has been merged.. please update your setup and try again.

Close when you verified it works :)

But4ler commented 4 years ago

Hello @tobiasehlert Now, it's good for me! Thanks :)

Maybe it's time for a new release ? The latest release (2.1.0) is dated November 25, 2019.

dj-wasabi commented 4 years ago

Hi @But4ler

Yes indeed. I need to fix some things but ideally, I want to create a release this weekend.

dj-wasabi commented 4 years ago

New release has been released and therefor I close this issue.