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

Support for Custom Headers in httpApi #1119

Open
niklasweimann opened this issue Nov 9, 2023 · 0 comments
Open

Support for Custom Headers in httpApi #1119

niklasweimann opened this issue Nov 9, 2023 · 0 comments
Labels
enhancement New feature or request module The issue or pull request is related to Zabbix module

Comments

@niklasweimann
Copy link

SUMMARY

Adding the ability to create custom headers to the httpapi plugin.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

httpapi-plugin

ADDITIONAL INFORMATION

I would like to send a custom header with each request to the zabbix api. Such headers are required to authenticate the request to the zabbix instance.

- name: Create maintenance for host
  vars:
    ansible_become: false
    ansible_network_os: community.zabbix.zabbix
    ansible_connection: httpapi
    ansible_httpapi_port: 443
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: true
    #begin new value
    ansible_httpapi_headers:
        - name: AccessToken
           value: SomeAccessToken
        - name: SecretToken
           value: SuperSecretToken
    #end new value
    ansible_user: "{{ zabbix_maintenance_user_name }}"
    ansible_host: "{{ zabbix_host_url }}"
    ansible_httpapi_pass: "{{ zabbix_maintenance_user_password }}"
  community.zabbix.zabbix_maintenance:
    name: "Update of {{ stack_name }} - {{ ansible_hostname }}"
    host_name: "{{ ansible_hostname }}"
    state: present
    minutes: "{{ zabbix_maintenance_duration | default(15) }}"
  # This call will fail on the first execution of a new server. So we ignore any errors
  ignore_errors: true
@BGmot BGmot added the enhancement New feature or request label Nov 12, 2023
@pyrodie18 pyrodie18 added the module The issue or pull request is related to Zabbix module label Nov 13, 2023
@niklasweimann niklasweimann changed the title Support for Customer Headers in httpApi Support for Custom Headers in httpApi May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module The issue or pull request is related to Zabbix module
Projects
None yet
Development

No branches or pull requests

3 participants