Server IP : 85.214.239.14 / Your IP : 3.22.194.5 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Mon Sep 30 15:36:27 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_proxy/tasks/ |
Upload File : |
--- # tasks file for zabbix_proxy - name: "Include OS-specific variables" include_vars: "{{ ansible_os_family }}.yml" - name: Determine Latest Supported Zabbix Version set_fact: zabbix_proxy_version: "{{ zabbix_valid_proxy_versions[ansible_distribution_major_version][0] | default(6.0) }}" when: zabbix_proxy_version is not defined - name: "Replace Sangoma with RedHat task" set_fact: ansible_os_family: "RedHat" when: - ansible_os_family == 'Sangoma' - name: "Set default ip address for zabbix_proxy_ip" set_fact: zabbix_proxy_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4'].address }}" when: - zabbix_proxy_ip is not defined - "'ansible_default_ipv4' in hostvars[inventory_hostname]" - name: "Set OS dependent variables" include_vars: "{{ item }}" with_first_found: - "../vars/{{ ansible_distribution }}.yml" - "../vars/main.yml" - name: "Install the correct repository" include_tasks: "{{ ansible_os_family }}.yml" - name: "Installing the {{ zabbix_proxy_database_long }} database" include_tasks: "{{ zabbix_proxy_database_long }}.yml" - name: "Create include dir zabbix-proxy" file: path: "{{ zabbix_proxy_include }}" owner: zabbix group: zabbix mode: "{{ zabbix_proxy_include_mode }}" state: directory become: true - name: "Create module dir zabbix-proxy" file: path: "{{ zabbix_proxy_loadmodulepath }}" owner: zabbix group: zabbix state: directory mode: "0755" become: true - name: "Create directory for PSK file if not exist." file: path: "{{ zabbix_proxy_tlspskfile | dirname }}" mode: 0755 state: directory become: true when: - zabbix_proxy_tlspskfile is defined - name: "Place TLS PSK File" copy: dest: "{{ zabbix_proxy_tlspskfile }}" content: "{{ zabbix_proxy_tlspsk_secret }}" owner: zabbix group: zabbix mode: 0400 become: true when: - zabbix_proxy_tlspskfile is defined - zabbix_proxy_tlspsk_secret is defined notify: - restart zabbix-proxy - name: "Allow zabbix-proxy to open connections (SELinux)" ansible.posix.seboolean: name: zabbix_can_network persistent: true state: true become: true when: ansible_selinux.status == "enabled" tags: selinux - name: "Allow zabbix-proxy to connect to zabbix_proxy_preprocessing.sock (SELinux)" ansible.posix.seboolean: name: daemons_enable_cluster_mode persistent: true state: true become: true when: ansible_selinux.status == "enabled" tags: selinux - name: "Configure zabbix-proxy" template: src: zabbix_proxy.conf.j2 dest: /etc/zabbix/zabbix_proxy.conf owner: zabbix group: zabbix mode: "{{ zabbix_proxy_conf_mode }}" notify: restart zabbix-proxy become: true - name: Ensure proxy definition is up-to-date (added/updated/removed) vars: gather_facts: false ansible_user: "{{ zabbix_api_login_user }}" ansible_network_os: community.zabbix.zabbix ansible_connection: httpapi # Can't think of a way to make http_login_* vars be undefined -( http_login_user: "{{ zabbix_api_http_user | default(zabbix_http_user | default(-42)) }}" http_login_password: "{{ zabbix_api_http_password | default(zabbix_http_password | default(-42)) }}" community.zabbix.zabbix_proxy: state: "{{ zabbix_proxy_state }}" status: "{{ zabbix_proxy_status }}" proxy_name: "{{ zabbix_proxy_name }}" description: "{{ zabbix_proxy_description | default(omit) }}" interface: "{{ zabbix_proxy_interface }}" tls_psk: "{{ zabbix_proxy_tlspsk_secret | default(omit) }}" tls_psk_identity: "{{ zabbix_proxy_tlspskidentity | default(omit) }}" tls_subject: "{{ zabbix_proxy_tls_subject | default(omit) }}" tls_connect: "{{ zabbix_proxy_tls_config[zabbix_proxy_tlsaccept if zabbix_proxy_tlsaccept else 'no_encryption'] }}" tls_accept: "{{ zabbix_proxy_tls_config[zabbix_proxy_tlsconnect if zabbix_proxy_tlsconnect else 'no_encryption'] }}" when: - zabbix_api_create_proxy | bool delegate_to: "{{ zabbix_api_server_host }}" become: false tags: - api - name: "zabbix-proxy started" service: name: zabbix-proxy state: started enabled: true become: true when: zabbix_proxy_manage_service | bool