Server IP : 85.214.239.14 / Your IP : 18.218.107.101 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 : |
--- # Tasks specific for Debian/Ubuntu Systems - name: "Include Zabbix gpg ids" include_vars: zabbix.yml - name: "Set short version name" set_fact: zabbix_short_version: "{{ zabbix_version | regex_replace('\\.', '') }}" zabbix_underscore_version: "{{ zabbix_version | regex_replace('\\.', '_') }}" - name: "Debian | Installing gnupg" apt: pkg: gnupg update_cache: true cache_valid_time: 3600 force: true state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" register: gnupg_installed until: gnupg_installed is succeeded become: true - name: "Debian | Install gpg key" apt_key: id: "{{ sign_keys[zabbix_short_version][zabbix_agent_distribution_release]['sign_key'] }}" url: http://repo.zabbix.com/zabbix-official-repo.key environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" when: - zabbix_repo == "zabbix" become: true tags: - zabbix-agent - init - name: "Debian | Check for zabbix repositories" find: paths: /etc/apt/sources.list.d patterns: repo_zabbix_com_zabbix*.list excludes: "repo_zabbix_com_zabbix_{{ zabbix_underscore_version }}_ubuntu.list" register: repositories become: true when: - ansible_distribution in ['Ubuntu', 'Debian'] - zabbix_repo == "zabbix" tags: - zabbix-agent - init - name: "Debian | Remove unecessary zabbix repositories" file: path: "{{ item.path }}" state: absent loop: "{{ repositories.files }}" when: - ansible_distribution in ['Ubuntu', 'Debian'] - zabbix_repo == "zabbix" - zabbix_agent_src_reinstall become: true tags: - zabbix-agent - init - name: "Debian | Installing deb-src repository Debian" apt_repository: repo: "deb-src http://repo.zabbix.com/zabbix/{{ zabbix_version }}/debian/ {{ zabbix_agent_distribution_release }} main" state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" when: - ansible_distribution == "Debian" - zabbix_repo == "zabbix" become: true tags: - zabbix-agent - init - name: "Debian | Installing deb repository Debian" apt_repository: repo: "deb http://repo.zabbix.com/zabbix/{{ zabbix_version }}/debian/ {{ zabbix_agent_distribution_release }} main" state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" when: - ansible_distribution == "Debian" - zabbix_repo == "zabbix" become: true tags: - zabbix-agent - init - name: "Debian | Installing deb-src repository Ubuntu Arm64" apt_repository: repo: "deb-src http://repo.zabbix.com/zabbix/{{ zabbix_version }}/ubuntu-arm64/ {{ zabbix_agent_distribution_release }} main" state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" when: - ansible_distribution == "Ubuntu" - ansible_machine == "aarch64" - zabbix_repo == "zabbix" become: true tags: - zabbix-agent - init - name: "Debian | Installing deb repository Ubuntu Arm64" apt_repository: repo: "deb http://repo.zabbix.com/zabbix/{{ zabbix_version }}/ubuntu-arm64/ {{ zabbix_agent_distribution_release }} main" state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" when: - ansible_distribution == "Ubuntu" - ansible_machine == "aarch64" - zabbix_repo == "zabbix" become: true tags: - zabbix-agent - init - name: "Debian | Installing deb-src repository Ubuntu" apt_repository: repo: "deb-src http://repo.zabbix.com/zabbix/{{ zabbix_version }}/ubuntu/ {{ zabbix_agent_distribution_release }} main" state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" when: - ansible_distribution == "Ubuntu" - ansible_machine != "aarch64" - zabbix_repo == "zabbix" become: true tags: - zabbix-agent - init - name: "Debian | Installing deb repository Ubuntu" apt_repository: repo: "deb http://repo.zabbix.com/zabbix/{{ zabbix_version }}/ubuntu/ {{ zabbix_agent_distribution_release }} main" state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" when: - ansible_distribution == "Ubuntu" - ansible_machine != "aarch64" - zabbix_repo == "zabbix" become: true tags: - zabbix-agent - init - name: "Debian | Create /etc/apt/preferences.d/" file: path: /etc/apt/preferences.d/ state: directory mode: '0755' when: - zabbix_agent_apt_priority | int become: true - name: "Debian | Configuring the weight for APT" copy: dest: "/etc/apt/preferences.d/zabbix-agent-{{ zabbix_underscore_version }}" content: | Package: {{ zabbix_agent_package }} Pin: origin repo.zabbix.com Pin-Priority: {{ zabbix_agent_apt_priority | int }} owner: root mode: '0644' when: - zabbix_agent_apt_priority | int become: true # Note: set cache_valid_time=0 to ensure that an apt-get update after the added repo-key # else you often get 'WARNING: The following packages cannot be authenticated! # See also: # http://askubuntu.com/questions/75565/why-am-i-getting-authentication-errors-for-packages-from-an-ubuntu-repository - name: "Debian | Installing zabbix-agent" apt: pkg: "{{ zabbix_agent_package }}" state: "{{ zabbix_agent_package_state }}" update_cache: true cache_valid_time: 0 force_apt_get: "{{ zabbix_apt_force_apt_get }}" install_recommends: "{{ zabbix_apt_install_recommends }}" environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" when: ansible_distribution in ['Ubuntu', 'Debian'] register: zabbix_agent_package_installed until: zabbix_agent_package_installed is succeeded become: true tags: - zabbix-agent - init - name: "Debian | Installing zabbix-{sender,get}" apt: pkg: - "{{ zabbix_sender_package }}" - "{{ zabbix_get_package }}" state: "{{ zabbix_agent_package_state }}" update_cache: true cache_valid_time: 0 force_apt_get: "{{ zabbix_apt_force_apt_get }}" install_recommends: "{{ zabbix_apt_install_recommends }}" environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" when: - ansible_distribution in ['Ubuntu', 'Debian'] - not zabbix_agent_install_agent_only register: zabbix_agent_package_installed until: zabbix_agent_package_installed is succeeded become: true check_mode: false tags: - zabbix-agent - init - name: "Mint | Installing zabbix-agent" apt: pkg: "zabbix-agent" state: "{{ zabbix_agent_package_state }}" update_cache: true cache_valid_time: 0 force_apt_get: "{{ zabbix_apt_force_apt_get }}" install_recommends: "{{ zabbix_apt_install_recommends }}" environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" when: ansible_distribution not in ['Ubuntu', 'Debian'] register: zabbix_agent_package_installed until: zabbix_agent_package_installed is succeeded become: true tags: - zabbix-agent - init - name: "Debian | Enable the service" service: name: "{{ zabbix_agent_service }}" enabled: true use: service become: true tags: - zabbix-agent - init - service