Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 52.14.201.216
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/python3/dist-packages/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/api.yml
---
- name: "API | Create host groups"
  community.zabbix.zabbix_group:
    host_group: "{{ zabbix_host_groups }}"
    state: "{{ zabbix_agent_hostgroups_state }}"
    validate_certs: "{{ zabbix_api_validate_certs|default(omit) }}"
    timeout: "{{ zabbix_api_timeout }}"
  when:
    - zabbix_api_create_hostgroup | bool
  register: zabbix_api_hostgroup_created
  until: zabbix_api_hostgroup_created is succeeded
  delegate_to: "{{ zabbix_api_server_host }}"
  become: false
  tags:
    - api

- name: "API | Create a new host or update an existing host's info"
  community.zabbix.zabbix_host:
    host_name: "{{ zabbix_agent_hostname }}"
    host_groups: "{{ zabbix_host_groups }}"
    link_templates: "{{ zabbix_agent_link_templates }}"
    status: "{{ zabbix_host_status }}"
    state: "{{ zabbix_agent_host_state }}"
    force: "{{ zabbix_agent_host_update }}"
    proxy: "{{ zabbix_agent_proxy }}"
    inventory_mode: "{{ zabbix_agent_inventory_mode }}"
    interfaces: "{{ zabbix_agent_interfaces }}"
    visible_name: "{{ zabbix_agent_visible_hostname | default(zabbix_agent_hostname) }}"
    tls_psk: "{{ zabbix_agent_tlspsk_secret | default(omit) }}"
    tls_psk_identity: "{{ zabbix_agent_tlspskidentity | default(omit) }}"
    tls_issuer: "{{ zabbix_agent_tlsservercertissuer | default(omit) }}"
    tls_subject: "{{ zabbix_agent_tls_subject | default(omit) }}"
    tls_accept: "{{ zabbix_agent_tls_config[zabbix_agent_tlsaccept if zabbix_agent_tlsaccept else 'unencrypted'] }}"
    tls_connect: "{{ zabbix_agent_tls_config[zabbix_agent_tlsconnect if zabbix_agent_tlsconnect else 'unencrypted'] }}"
    validate_certs: "{{ zabbix_api_validate_certs | default(omit) }}"
    timeout: "{{ zabbix_api_timeout }}"
    description: "{{ zabbix_agent_description | default(omit) }}"
    inventory_zabbix: "{{ zabbix_agent_inventory_zabbix | default({}) }}"
    ipmi_authtype: "{{ zabbix_agent_ipmi_authtype | default(omit) }}"
    ipmi_password: "{{ zabbix_agent_ipmi_password| default(omit) }}"
    ipmi_privilege: "{{ zabbix_agent_ipmi_privilege | default(omit) }}"
    ipmi_username: "{{ zabbix_agent_ipmi_username | default(omit) }}"
    tags: "{{ zabbix_agent_tags }}"
  when:
    - not zabbix_agent2
  register: zabbix_api_host_created
  until: zabbix_api_host_created is succeeded
  delegate_to: "{{ zabbix_api_server_host }}"
  become: false
  changed_when: false
  tags:
    - api

- name: "API | Create a new host using agent2 or update an existing host's info"
  community.zabbix.zabbix_host:
    host_name: "{{ zabbix_agent2_hostname }}"
    host_groups: "{{ zabbix_host_groups }}"
    link_templates: "{{ zabbix_agent_link_templates }}"
    status: "{{ zabbix_host_status }}"
    state: "{{ zabbix_agent_host_state }}"
    force: "{{ zabbix_agent_host_update }}"
    proxy: "{{ zabbix_agent_proxy }}"
    inventory_mode: "{{ zabbix_agent_inventory_mode }}"
    interfaces: "{{ zabbix_agent_interfaces }}"
    visible_name: "{{ zabbix_agent_visible_hostname | default(zabbix_agent2_hostname) }}"
    tls_psk: "{{ zabbix_agent2_tlspsk_secret | default(omit) }}"
    tls_psk_identity: "{{ zabbix_agent2_tlspskidentity | default(omit) }}"
    tls_issuer: "{{ zabbix_agent2_tlsservercertissuer | default(omit) }}"
    tls_subject: "{{ zabbix_agent2_tls_subject | default(omit) }}"
    tls_accept: "{{ zabbix_agent_tls_config[zabbix_agent2_tlsaccept if zabbix_agent2_tlsaccept else 'unencrypted'] }}"
    tls_connect: "{{ zabbix_agent_tls_config[zabbix_agent2_tlsconnect if zabbix_agent2_tlsconnect else 'unencrypted'] }}"
    validate_certs: "{{ zabbix_api_validate_certs | default(omit) }}"
    timeout: "{{ zabbix_api_timeout }}"
    description: "{{ zabbix_agent_description | default(omit) }}"
    inventory_zabbix: "{{ zabbix_agent_inventory_zabbix | default({}) }}"
    ipmi_authtype: "{{ zabbix_agent_ipmi_authtype | default(omit) }}"
    ipmi_password: "{{ zabbix_agent_ipmi_password| default(omit) }}"
    ipmi_privilege: "{{ zabbix_agent_ipmi_privilege | default(omit) }}"
    ipmi_username: "{{ zabbix_agent_ipmi_username | default(omit) }}"
    tags: "{{ zabbix_agent_tags }}"
  when:
    - zabbix_agent2 | bool
  register: zabbix_api_host_created
  until: zabbix_api_host_created is succeeded
  delegate_to: "{{ zabbix_api_server_host }}"
  become: false
  changed_when: false
  tags:
    - api

- name: "API | Updating host configuration with macros"
  community.zabbix.zabbix_hostmacro:
    host_name: "{{ (zabbix_agent2 | bool) | ternary(zabbix_agent2_hostname, zabbix_agent_hostname) }}"
    macro_name: "{{ item.macro_key }}"
    macro_value: "{{ item.macro_value }}"
    macro_type: "{{ item.macro_type|default('text') }}"
    validate_certs: "{{ zabbix_api_validate_certs | default(omit) }}"
    timeout: "{{ zabbix_api_timeout }}"
  with_items: "{{ zabbix_agent_macros | default([]) }}"
  when:
    - zabbix_agent_macros is defined
    - item.macro_key is defined
  register: zabbix_api_hostmarcro_created
  until: zabbix_api_hostmarcro_created is succeeded
  delegate_to: "{{ zabbix_api_server_host }}"
  become: false
  tags:
    - api

Anon7 - 2022
AnonSec Team