Skip to content

Commit

Permalink
feat: zabbix-web installation on suse
Browse files Browse the repository at this point in the history
  • Loading branch information
jon4hz committed Mar 24, 2024
1 parent 98083fe commit 23f2acb
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ jobs:
- debian12
- debian11
- debian10
# - opensuseleap15
collection_role:
- zabbix_web
database:
- mysql
- pgsql
web_server:
# maybe add apache?
- nginx
version:
- v64
Expand Down
16 changes: 16 additions & 0 deletions molecule/zabbix_web/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- ansible_os_family != 'Suse'

- name: "Installing packages on NON-CentOS"
ansible.builtin.apt:
Expand All @@ -106,6 +107,21 @@
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- ansible_os_family != 'Suse'

- name: "Installing packages on Suse"
community.general.zypper:
name:
- iproute2
- python3-pip
- sudo
- curl
update_cache: true
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family == 'Suse'

- name: "Configure SUDO."
ansible.builtin.lineinfile:
Expand Down
11 changes: 11 additions & 0 deletions roles/zabbix_web/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ zabbix_repo_yum:
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
state: present

zabbix_repo_zypper_auto_import_keys: true
zabbix_repo_zypper_disable_gpg_check: false
zabbix_repo_zypper_schema: https
zabbix_repo_zypper:
- name: zabbix
description: Zabbix Official Repository
repo: "{{ zabbix_repo_zypper_schema }}://repo.zabbix.com/zabbix/{{ zabbix_web_version | regex_search('^[0-9]+.[0-9]+') }}/sles/{{ ansible_distribution_major_version }}/$basearch/"
disable_gpg_check: "{{ zabbix_repo_zypper_disable_gpg_check }}"
auto_import_keys: "{{ zabbix_repo_zypper_auto_import_keys }}"
state: present

# Elasticsearch
# zabbix_server_history_url:
# - "'uint' => 'http://localhost:9200'"
Expand Down
35 changes: 35 additions & 0 deletions roles/zabbix_web/tasks/Suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
- name: "Suse | Setting Short PHP Version"
ansible.builtin.set_fact:
zabbix_web_php_installed_version: "{{ zabbix_web_php_installed_version | regex_replace('\\.', '') }}"
tags:
- always

- name: "Suse | Install repos"
community.general.zypper_repository:
name: "{{ item.name }}"
description: "{{ item.description }}"
repo: "{{ item.repo }}"
disable_gpg_check: "{{ item.disable_gpg_check | default(false) }}"
auto_import_keys: "{{ item.auto_import_keys | default('true') }}"
priority: "{{ item.priority | default('99') }}"
runrefresh: "{{ item.runrefresh | default(false) }}"
state: "{{ item.state | default('present') }}"
with_items: "{{ zabbix_repo_zypper }}"
become: true
tags:
- install

- name: "Suse | Install zabbix-web-{{ zabbix_server_database }}"
ansible.builtin.package:
pkg:
- "zabbix-web-{{ zabbix_server_database }}"
state: "{{ zabbix_web_package_state }}"
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:
- install
23 changes: 23 additions & 0 deletions roles/zabbix_web/vars/Suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
_apache_user: wwwrun
_apache_group: wwwrun
_apache_log: apache2
_apache_service: apache2
_apache_vhost_location: /etc/apache2/conf.d/zabbix.conf

_php_fpm_dir: /etc/php-fpm.d
_php_fpm_session: /var/lib/php/session
_zabbix_php_fpm_listen: /run/php-fpm/zabbix.sock

_nginx_user: nginx
_nginx_group: nginx
_nginx_vhost_location: /etc/nginx/conf.d/zabbix.conf
_nginx_log_path: /var/log/nginx
_nginx_service: nginx


zabbix_valid_web_versions:
"15":
- 6.4
- 6.2
- 6.0

0 comments on commit 23f2acb

Please sign in to comment.