Skip to content

Commit

Permalink
fix: install suse repo with zabbix_repo role
Browse files Browse the repository at this point in the history
  • Loading branch information
jon4hz committed Jun 7, 2024
1 parent 1e33806 commit bfe10c9
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 132 deletions.
1 change: 1 addition & 0 deletions .github/workflows/repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- ubuntu2004
- debian12
- debian11
- opensuseleap15
collection_role:
- zabbix_repo
version:
Expand Down
1 change: 1 addition & 0 deletions molecule/zabbix_repo/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- ansible_os_family != 'Suse'

- name: "Configure SUDO."
ansible.builtin.lineinfile:
Expand Down
11 changes: 0 additions & 11 deletions roles/zabbix_agent/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@ zabbix_apt_install_recommends: false
zabbix_agent_disable_repo:
- epel

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_agent_version }}/sles/{{ zabbix_agent_distribution_major_version }}/$basearch/"
disable_gpg_check: "{{ zabbix_repo_zypper_disable_gpg_check }}"
auto_import_keys: "{{ zabbix_repo_zypper_auto_import_keys }}"
state: present

# Zabbix API stuff
zabbix_api_server_host: localhost
zabbix_api_login_user: Admin
Expand Down
15 changes: 0 additions & 15 deletions roles/zabbix_agent/tasks/Suse.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
---
# Tasks specific for SUSE systems

- 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: Check if warn parameter can be used for shell module
ansible.builtin.set_fact:
produce_warn: false
Expand Down
11 changes: 0 additions & 11 deletions roles/zabbix_javagateway/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ zabbix_java_gateway_conf_mode: "0644"
zabbix_javagateway_disable_repo:
- epel

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_javagateway_version }}/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

zabbix_javagateway_openjdk_version: 17

zabbix_javagateway_pidfile: /run/zabbix/zabbix_java_gateway.pid
Expand Down
15 changes: 0 additions & 15 deletions roles/zabbix_javagateway/tasks/Suse.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
---
# Tasks specific for Suse systems

- 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

# SLES 15 comes with openjdk-11 by default.
# In order for the zabbix-java-gateway to work, we need to install openjdk-17.
- name: "Suse | Install openjdk-{{ zabbix_javagateway_openjdk_version }}"
Expand Down
11 changes: 0 additions & 11 deletions roles/zabbix_proxy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ zabbix_proxy_version_minor: "*"
# Yum/APT Variables
zabbix_proxy_package_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_proxy_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

# Proxy Configuration Variables (Only ones with role provided defaults)
zabbix_proxy_allowroot: 0
zabbix_proxy_allowunsupporteddbversions: 0
Expand Down
15 changes: 0 additions & 15 deletions roles/zabbix_proxy/tasks/Suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@
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: Install packages for Zabbix Repository
tags:
- install
Expand Down
11 changes: 11 additions & 0 deletions roles/zabbix_repo/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,14 @@ zabbix_repo_apt_priority:
zabbix_repo_deb_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key
zabbix_repo_deb_include_deb_src: true
zabbix_repo_rpm_gpg_key_url: http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD

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_repo_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
17 changes: 17 additions & 0 deletions roles/zabbix_repo/tasks/Suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# Tasks specific for Suse systems

- 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
1 change: 1 addition & 0 deletions roles/zabbix_repo/vars/Suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
11 changes: 0 additions & 11 deletions roles/zabbix_server/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ zabbix_server_version_minor: "*"
zabbix_server_package_state: present
zabbix_server_conf_mode: 0640

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_server_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

# Server Configuration Variables (Only ones with role provided defaults)
zabbix_server_alertscriptspath: /usr/lib/zabbix/alertscripts
zabbix_server_allowroot: 0
Expand Down
15 changes: 0 additions & 15 deletions roles/zabbix_server/tasks/Suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,6 @@
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 | Installing zabbix-server-{{ zabbix_server_database }}"
ansible.builtin.package:
pkg: "{{ zabbix_server_package }}"
Expand Down
11 changes: 0 additions & 11 deletions roles/zabbix_web/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,6 @@ zabbix_web_version_minor: "*"
zabbix_web_disable_repo:
- epel

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
2 changes: 0 additions & 2 deletions roles/zabbix_web/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
become: true
when:
- ansible_os_family == 'Debian'
- zabbix_web_version is version('5.0', '>=')

- name: restart php-fpm
ansible.builtin.service:
Expand All @@ -45,7 +44,6 @@
become: true
when:
- ansible_os_family == 'Suse'
- zabbix_web_version is version('5.0', '>=')

- name: "clean repo files from proxy creds"
ansible.builtin.shell: ls /etc/yum.repos.d/zabbix* && sed -i 's/^proxy =.*//' /etc/yum.repos.d/zabbix* || true
Expand Down
15 changes: 0 additions & 15 deletions roles/zabbix_web/tasks/Suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@
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:
Expand Down

0 comments on commit bfe10c9

Please sign in to comment.