Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 18.219.40.177
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/python3/dist-packages/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/Debian.yml
---
- name: "Include Zabbix gpg ids"
  include_vars: zabbix.yml

- name: "Set some variables"
  set_fact:
    zabbix_short_version: "{{ zabbix_version | regex_replace('\\.', '') }}"
    zabbix_proxy_apt_repository:
      - "http://repo.zabbix.com/zabbix/{{ zabbix_version }}/{{ ansible_distribution.lower() }}/"
      - "{{ ansible_distribution_release }}"
      - "main"
    zabbix_underscore_version: "{{ zabbix_version | regex_replace('\\.', '_') }}"
    zabbix_python_prefix: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}"
  when:
    - ansible_machine != "aarch64"

- name: "Set some variables"
  set_fact:
    zabbix_short_version: "{{ zabbix_version | regex_replace('\\.', '') }}"
    zabbix_proxy_apt_repository:
      - "http://repo.zabbix.com/zabbix/{{ zabbix_version }}/{{ ansible_distribution.lower() }}-arm64/"
      - "{{ ansible_distribution_release }}"
      - "main"
    zabbix_underscore_version: "{{ zabbix_version | regex_replace('\\.', '_') }}"
    zabbix_python_prefix: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}"
  when:
    - ansible_machine == "aarch64"

- name: "Debian | Set some facts"
  set_fact:
    apache_log: apache2
    datafiles_path: "/usr/share/zabbix-proxy-{{ zabbix_proxy_database }}"
  when:
    - zabbix_version is version_compare('3.0', '<')
  tags:
    - zabbix-proxy
    - init
    - config

- name: "Debian | Set some facts for Zabbix >= 3.0 && < 5.4"
  set_fact:
    apache_log: apache2
    datafiles_path: /usr/share/doc/zabbix-proxy-{{ zabbix_proxy_database }}
  when:
    - zabbix_version is version('3.0', '>=')
    - zabbix_version is version('5.4', '<')
  tags:
    - zabbix-proxy
    - init
    - config

- name: "Debian | Set some facts for Zabbix == 5.4"
  set_fact:
    datafiles_path: /usr/share/doc/zabbix-sql-scripts/{{ zabbix_proxy_database_long }}
  when:
    - zabbix_version is version('5.4', '==')
  tags:
    - zabbix-proxy
    - init
    - config

- name: "Debian | Set some facts for Zabbix >= 6.0"
  set_fact:
    datafiles_path: /usr/share/zabbix-sql-scripts/{{ zabbix_proxy_database_long }}
  when:
    - zabbix_version is version('6.0', '>=')
  tags:
    - zabbix-proxy
    - init
    - config

- 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][ansible_distribution_release]['sign_key'] }}"
    url: http://repo.zabbix.com/zabbix-official-repo.key
  register: are_zabbix_proxy_dependency_packages_installed
  until: are_zabbix_proxy_dependency_packages_installed is succeeded
  when:
    - zabbix_repo == "zabbix"
  become: true
  tags:
    - zabbix-proxy
    - init

- name: "Debian | Installing repository {{ ansible_distribution }}"
  apt_repository:
    repo: "{{ item }} {{ zabbix_proxy_apt_repository | join(' ') }}"
    state: present
  when: zabbix_repo == "zabbix"
  become: true
  with_items:
    - deb-src
    - deb
  tags:
    - zabbix-proxy
    - init
    
- name: "Debian | Create /etc/apt/preferences.d/"
  file:
    path: /etc/apt/preferences.d/
    state: directory
    mode: '0755'
  when:
    - zabbix_proxy_apt_priority | int
  become: true
  
- name: "Debian | Configuring the weight for APT"
  copy:
    dest: "/etc/apt/preferences.d/zabbix-proxy-{{ zabbix_proxy_database }}"
    content: |
      Package: zabbix-proxy-{{ zabbix_proxy_database }}
      Pin: origin repo.zabbix.com
      Pin-Priority: {{ zabbix_proxy_apt_priority }}
    owner: root
    mode: '0644'
  when:
    - zabbix_proxy_apt_priority | int
  become: true

- name: Check if warn parameter can be used for shell module
  set_fact:
    produce_warn: False
  when: ansible_version.full is version("2.14", "<")

- name: apt-get clean
  shell: apt-get clean; apt-get update
  args:
    warn: "{{ produce_warn | default(omit) }}"
  changed_when: false
  become: true
  tags:
    - skip_ansible_lint
    
# On certain 18.04 images, such as docker or lxc, dpkg is configured not to
# install files into paths /usr/share/doc/*
# Since this is where Zabbix installs its database schemas, we need to allow
# files to be installed to /usr/share/doc/zabbix*
- name: Check for the dpkg exclude line
  command: grep -F 'path-exclude=/usr/share/doc/*' /etc/dpkg/dpkg.cfg.d/excludes
  register: dpkg_exclude_line
  failed_when: false
  changed_when: false
  check_mode: false
 
- name: Allow Zabbix dpkg installs to /usr/share/doc/zabbix*
  lineinfile:
    path: /etc/dpkg/dpkg.cfg.d/excludes
    line: 'path-include=/usr/share/doc/zabbix*'
  become: true
  when:
    - dpkg_exclude_line.rc == 0

- name: "Debian | Installing zabbix-proxy-{{ zabbix_proxy_database }}"
  apt:
    pkg: zabbix-proxy-{{ zabbix_proxy_database }}
    state: "{{ zabbix_proxy_package_state }}"
    update_cache: true
    cache_valid_time: 0
    install_recommends: "{{ zabbix_proxy_install_recommends }}"
    default_release: "{{ ansible_distribution_release }}"
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: zabbix_proxy_package_installed
  until: zabbix_proxy_package_installed is succeeded
  become: true
  tags:
    - zabbix-proxy
    - init

- name: "Debian | Installing zabbix-sql-scripts"
  apt:
    pkg: zabbix-sql-scripts
    state: "{{ zabbix_proxy_package_state }}"
    update_cache: true
    cache_valid_time: 0
    default_release: "{{ ansible_distribution_release }}"
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: zabbix_proxy_package_sql_installed
  until: zabbix_proxy_package_sql_installed is succeeded
  when:
    - zabbix_version is version('5.4', '>=')
  become: true
  tags:
    - zabbix-proxy
    - init

- name: "Debian | Install Ansible module dependencies"
  apt:
    name: "{{ zabbix_python_prefix }}-psycopg2"
    state: present
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: zabbix_proxy_dependencies_installed
  until: zabbix_proxy_dependencies_installed is succeeded
  become: true
  when:
    - zabbix_database_creation
  tags:
    - zabbix-proxy
    - init

- name: "Debian | Install Mysql Client package"
  apt:
    name:
      - default-mysql-client
      - "{{ zabbix_python_prefix }}-mysqldb"
    state: present
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: zabbix_proxy_dependencies_installed
  until: zabbix_proxy_dependencies_installed is succeeded
  become: true
  when:
    - zabbix_proxy_database == 'mysql'
    - zabbix_proxy_install_database_client
    - ansible_distribution_release != "buster"
  tags:
    - zabbix-proxy
    - init
    - database

- name: "Debian 10 | Install Mysql Client package"
  apt:
    name:
      - mariadb-client
      - "{{ zabbix_python_prefix }}-mysqldb"
    state: present
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: zabbix_proxy_dependencies_installed
  until: zabbix_proxy_dependencies_installed is succeeded
  become: true
  when:
    - zabbix_proxy_database == 'mysql'
    - zabbix_proxy_install_database_client
    - ansible_distribution_release == "buster"
  tags:
    - zabbix-proxy
    - init
    - database

- name: "Debian | Install PostgreSQL Client package"
  apt:
    name: postgresql-client
    state: present
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: are_zabbix_proxy_dependency_packages_installed
  until: are_zabbix_proxy_dependency_packages_installed is succeeded
  become: true
  when:
    - zabbix_database_creation or zabbix_database_sqlload
    - zabbix_proxy_database == 'pgsql'
    - zabbix_proxy_install_database_client
  tags:
    - zabbix-proxy
    - init
    - database

- name: "Debian | Install sqlite3"
  apt:
    name: sqlite3
    state: present
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: are_zabbix_proxy_dependency_packages_installed
  until: are_zabbix_proxy_dependency_packages_installed is succeeded
  become: true
  when:
    - zabbix_proxy_database == 'sqlite3'
  tags:
    - zabbix-proxy

Anon7 - 2022
AnonSec Team