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

Unsupported Parameter for server_url #1445

Open
dilip400590 opened this issue Jan 17, 2025 · 3 comments
Open

Unsupported Parameter for server_url #1445

dilip400590 opened this issue Jan 17, 2025 · 3 comments

Comments

@dilip400590
Copy link

Hello,

Im trying to delete the default zabbix configuration and i have created the plabook as below:

Zabbix Version : 7.0.8
OS Release: RHEL 8.10
Python 3.9
Ansible-core: 2.15.13


  • name: Delte default zabbix configuration
    hosts: zabbix_server
    connection: local
    become: false

    collections:

    • community.zabbix
    • community.mysql

    tasks:

    • name: Remove 'Zabbix server'
      community.zabbix.zabbix_host:
      zabbix_api_server_url: "{{ zabbix_api_server_url }}"
      http_login_user: "{{ zabbix_api_login_user }}"
      http_login_password: "{{ zabbix_api_login_pass }}"
      ca_cert: "{{ zabbix_api_validate_certs }}"
      host_name: 'Zabbix server'
      state: absent

    • name: Remove default templates and mediatypes
      command: "{{ ansible_python_interpreter }} /opt/cspzabbix/ansible/playbooks/zabbix/playbooks/config/removetemplates.py -s '{{ zabbix_api_server_url }}' -l '{{ zabbix_api_login_user }}' -p '{{ zabbix_api_login_pass }}' {{ zabbix_api_validate_certs | ternary('', '-n') }}"

While running the playbook im getting the below error:

(python) [root@cspzabbix zabbix]# ansible-playbook -i inventory -e @rhel_vars.yml playbooks/config/zabbix-delete-default.yml

PLAY [Delte default zabbix configuration] *************************************************************************************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
ok: [cspzabbix]

TASK [Remove 'Zabbix server'] *************************************************************************************************************************************************************************************
fatal: [cspzabbix]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (community.._host) module: api_server_url. Supported parameters include: ca_cert, description, force, host_groups, host_name, http_login_password, http_login_user, interfaces, inventory_mode, inventory, ipmi_authtype, ipmi_password, ipmi_privilege, ipmi_username, link_templates, macros, monitored_by, proxy, proxy_group, state, status, tags, tls_accept, tls_connect, tls_psk, tls_psk_identity, tls_subject, visible_name (host_tags, tls_issuer, user_macros)."}

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

Please help me to resolve the issue

@eb4x
Copy link
Collaborator

eb4x commented Jan 17, 2025

It's a bit hard to tell from this text output, try putting it in a code block using three backticks (```)

But by the looks of it, you're not indenting your yaml correctly.

@dilip400590
Copy link
Author

dilip400590 commented Jan 17, 2025

Im still getting the same error.

"fatal: [cspzabbix]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (community..host) module: server_url. Supported parameters include: ca_cert, description, force, host_groups, host_name, http_login_password, http_login_user, interfaces, inventory_mode, inventory********, ipmi_authtype, ipmi_password, ipmi_privilege, ipmi_username, link_templates, macros, monitored_by, proxy, proxy_group, state, status, tags, tls_accept, tls_connect, tls_psk, tls_psk_identity, tls_subject, visible_name (host_tags, tls_issuer, user_macros)."}"


Please provide me the valid parameter for server_url

@eb4x
Copy link
Collaborator

eb4x commented Jan 17, 2025

Depending on whether the api is running on zabbix_server, it looks like you want to try something like this.

- name: Delete default zabbix configuration
  hosts: zabbix_server

  tasks:
    - name: Remove 'Zabbix server'
      community.zabbix.zabbix_host:
        host_name: 'Zabbix server'
        state: absent
      delegate_to: "{{ zabbix_api_server_url }}"
    vars:
      ansible_network_os: community.zabbix.zabbix
      ansible_connection: httpapi
      ansible_httpapi_use_ssl: true
      ansible_user: "{{ zabbix_api_login_user }}"
      ansible_httpapi_pass: "{{ zabbix_api_login_pass }}"
      ansible_httpapi_port: 443
      ansible_zabbix_url_path: ''

    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants