Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 18.223.206.116
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_web/tasks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/python3/dist-packages/ansible_collections/community/zabbix/roles/zabbix_web/tasks/RedHat.yml
---
# Tasks specific for RedHat systems

- name: "RedHat | Install basic repo file"
  yum_repository:
    name: "{{ item.name }}"
    description: "{{ item.description }}"
    baseurl: "{{ item.baseurl }}"
    gpgcheck: "{{ item.gpgcheck }}"
    gpgkey: "{{ item.gpgkey }}"
    mode: "{{ item.mode | default('0644') }}"
    priority: "{{ item.priority | default('98') }}"
    state: "{{ item.state | default('present') }}"
    proxy: "{{ zabbix_http_proxy | default(omit) }}"
  with_items: "{{ zabbix_repo_yum }}"
  register: yum_repo_installed
  become: true
  when:
    zabbix_repo == "zabbix"
  notify:
    - "clean repo files from proxy creds"
  tags:
    - zabbix-web

- name: "RedHat | Install basic repo file (Zabbix 5.x)"
  yum_repository:
    name: "{{ item.name }}"
    description: "{{ item.description }}"
    baseurl: "{{ item.baseurl }}"
    gpgcheck: "{{ item.gpgcheck }}"
    gpgkey: "{{ item.gpgkey }}"
    mode: "{{ item.mode | default('0644') }}"
    priority: "{{ item.priority | default('98') }}"
    state: "{{ item.state | default('present') }}"
    proxy: "{{ zabbix_http_proxy | default(omit) }}"
  with_items: "{{ zabbix_5_repo_yum }}"
  become: true
  when:
    - zabbix_repo == "zabbix"
    - zabbix_version is version('5.0', '>=')
    - ansible_distribution_major_version != '8'
    - ansible_distribution_major_version != '9'
  notify:
    - "clean repo files from proxy creds"
  tags:
    - zabbix-web

- name: "RedHat | Install zabbix-web dependency (Zabbix 5.x) (CentOS)"
  yum:
    pkg:
      - centos-release-scl
    state: "{{ zabbix_web_package_state }}"
    update_cache: true
    disablerepo: "{{ '*' if (zabbix_repo_yum_enabled | length>0) else omit }}"
    enablerepo: "{{ zabbix_repo_yum_enabled if zabbix_repo_yum_enabled is iterable and (zabbix_repo_yum_enabled | length>0) else omit }}"
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: zabbix_web_dependency_package_install
  until: zabbix_web_dependency_package_install is succeeded
  become: true
  when:
    - zabbix_version is version('5.0', '>=')
    - zabbix_web_centos_release
    - ansible_distribution_major_version != '9'
    - ansible_distribution_major_version != '8'
    - ansible_distribution == "CentOS"
  tags:
    - zabbix-web

- name: "RedHat | Install zabbix-web dependency (Zabbix 5.x) (RHEL)"
  yum:
    pkg:
      - scl-utils
      - scl-utils-build
    state: "{{ zabbix_web_package_state }}"
    update_cache: true
    disablerepo: "{{ '*' if (zabbix_repo_yum_enabled | length>0) else omit }}"
    enablerepo: "{{ zabbix_repo_yum_enabled if zabbix_repo_yum_enabled is iterable and (zabbix_repo_yum_enabled | length>0) else omit }}"
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: zabbix_web_dependency_package_install
  until: zabbix_web_dependency_package_install is succeeded
  become: true
  when:
    - zabbix_version is version('5.0', '>=')
    - zabbix_web_centos_release
    - ansible_distribution_major_version != '9'
    - ansible_distribution_major_version != '8'
    - ansible_distribution == "RedHat"
  tags:
    - zabbix-web

- name: "RedHat | Install zabbix-web (Zabbix 5.x)"
  yum:
    pkg:
      - zabbix-apache-conf-scl-{{ zabbix_web_version }}.{{ zabbix_web_version_minor }}
    state: "{{ zabbix_web_package_state }}"
    update_cache: true
    disablerepo: "{{ '*' if (zabbix_repo_yum_enabled | length>0) else omit }}"
    enablerepo: "{{ zabbix_repo_yum_enabled if zabbix_repo_yum_enabled is iterable and (zabbix_repo_yum_enabled | length>0) else omit }}"
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: zabbix_web_package_install
  until: zabbix_web_package_install is succeeded
  become: true
  when:
    - zabbix_version is version('5.0', '>=')
    - ansible_distribution_major_version != '9'
    - ansible_distribution_major_version != '8'
    - zabbix_websrv == 'apache'
  tags:
    - zabbix-web

- name: "RedHat | Install zabbix-web-{{ zabbix_server_database }}"
  yum:
    pkg: zabbix-web-{{ zabbix_server_database }}{{ '-scl' if zabbix_version is version('5.0', '>=') and ansible_distribution_major_version|int < 8 else '' }}-{{ zabbix_web_version }}.{{ zabbix_web_version_minor }}
    state: "{{ zabbix_web_package_state }}"
    update_cache: true
    disablerepo: "{{ '*' if (zabbix_repo_yum_enabled | length>0) else omit }}"
    enablerepo: "{{ zabbix_repo_yum_enabled if zabbix_repo_yum_enabled is iterable and (zabbix_repo_yum_enabled | length>0) else omit }}"
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: zabbix_web_package_install
  until: zabbix_web_package_install is succeeded
  become: true
  tags:
    - zabbix-web

- name: RedHat 9 | Install PHP"
  package:
    name: php
    state: "{{ zabbix_php_install_state }}"
  when:
    - zabbix_version is version('6.0', '>=')
    - ansible_distribution_major_version == '9'
    - zabbix_vhost

- name: "RedHat | Install PHP"
  template:
    src: php-fpm.conf.j2
    dest: "{{ zabbix_php_fpm_dir }}/zabbix.conf"
    owner: "{{ zabbix_web_conf_web_user }}"
    group: "{{ zabbix_web_conf_web_group }}"
    mode: 0644
  become: true
  when:
    - zabbix_vhost
  notify:
    - restart redhat-php-fpm

- include_tasks: apache_RedHat.yml
  vars:
    zabbix_apache_servername: "{{ zabbix_websrv_servername }}"
  when:
    - zabbix_websrv == 'apache'

- name: "RedHat | Install Nginx vhost"
  template:
    src: nginx_vhost.conf.j2
    dest: /etc/nginx/conf.d/zabbix.conf
    owner: root
    group: root
    mode: 0644
  when:
    - zabbix_vhost
    - zabbix_websrv == 'nginx'
  become: true
  notify:
    - restart nginx
  tags:
    - zabbix-web
    - init
    - config
    - nginx

- name: "Configure SELinux when enabled"
  include_tasks: selinux.yml
  when:
    - zabbix_selinux | bool

Anon7 - 2022
AnonSec Team