Skip to content

Commit

Permalink
feat: support zabbix installation on suse (ansible-collections#1194)
Browse files Browse the repository at this point in the history
  • Loading branch information
jon4hz authored and emrocha committed Jul 1, 2024
1 parent 7e85893 commit 6c694cd
Show file tree
Hide file tree
Showing 50 changed files with 426 additions and 108 deletions.
1 change: 1 addition & 0 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- ubuntu2004
- debian12
- debian11
- opensuseleap15
version:
- v70
- v64
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/javagateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- ubuntu2004
- debian12
- debian11
- opensuseleap15
version:
- v70
- v64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- ubuntu2004
- debian12
- debian11
- opensuseleap15
collection_role:
- zabbix_proxy
database:
Expand All @@ -43,7 +44,6 @@ jobs:
- v70
- v64
- v60

steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down
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 .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- ubuntu2004
- debian12
- debian11
- opensuseleap15
collection_role:
- zabbix_server
database:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ jobs:
- ubuntu2004
- debian12
- debian11
# - opensuseleap15
collection_role:
- zabbix_web
database:
- mysql
- pgsql
web_server:
# maybe add apache?
- nginx
- apache
version:
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/pr_1194.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
major_changes:
- All Roles - Add support for openSUSE Leap 15 and SLES 15.
19 changes: 10 additions & 9 deletions docs/ZABBIX_AGENT_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,16 @@ To successfully complete the install the role requires `python-netaddr` on the c

See the following list of supported Operating systems with the Zabbix releases:

| Zabbix | 6.4 | 6.0 |
|---------------------|-----|-----|
| Red Hat Fam 9 | V | V |
| Red Hat Fam 8 | V | V |
| Ubuntu 24.04 noble | V | V |
| Ubuntu 22.04 jammy | V | V |
| Ubuntu 20.04 focal | V | V |
| Debian 12 bookworm | V | V |
| Debian 11 bullseye | V | V |
| Zabbix | 7.0 | 6.4 | 6.0 |
|---------------------|-----|-----|-----|
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Ubuntu 24.04 noble | V | V | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Debian 12 bookworm | V | V | V |
| Debian 11 bullseye | V | V | V |
| Suse Fam 15 | V | V | V |

You can bypass this matrix by setting `enable_version_check: false`

Expand Down
19 changes: 10 additions & 9 deletions docs/ZABBIX_JAVAGATEWAY_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ So, you'll need one of those operating systems.. :-)

See the following list of supported Operating systems with the Zabbix releases.

| Zabbix | 6.4 | 6.0 |
|---------------------|-----|-----|
| Red Hat Fam 9 | V | V |
| Red Hat Fam 8 | V | V |
| Ubuntu 24.04 noble | V | V |
| Ubuntu 22.04 jammy | V | V |
| Ubuntu 20.04 focal | V | V |
| Debian 12 bookworm | V | V |
| Debian 11 bullseye | V | V |
| Zabbix | 7.0 | 6.4 | 6.0 |
|---------------------|-----|-----|-----|
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Ubuntu 24.04 noble | V | V | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Debian 12 bookworm | V | V | V |
| Debian 11 bullseye | V | V | V |
| Suse Fam 15 | V | V | V |

You can bypass this matrix by setting `enable_version_check: false`

Expand Down
19 changes: 10 additions & 9 deletions docs/ZABBIX_PROXY_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,16 @@ ansible-galaxy collection install community.postgresql

See the following list of supported Operating systems with the Zabbix releases.

| Zabbix | 6.4 | 6.0 |
|---------------------|-----|-----|
| Red Hat Fam 9 | V | V |
| Red Hat Fam 8 | V | V |
| Ubuntu 24.04 noble | V | V |
| Ubuntu 22.04 jammy | V | V |
| Ubuntu 20.04 focal | V | V |
| Debian 12 bookworm | V | V |
| Debian 11 bullseye | V | V |
| Zabbix | 7.0 | 6.4 | 6.0 |
|---------------------|-----|-----|-----|
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Ubuntu 24.04 noble | V | V | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Debian 12 bookworm | V | V | V |
| Debian 11 bullseye | V | V | V |
| Suse Fam 15 | V | V | V |

You can bypass this matrix by setting `enable_version_check: false`

Expand Down
23 changes: 14 additions & 9 deletions docs/ZABBIX_REPO_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ Please send Pull Requests or suggestions when you want to use this role for othe

See the following list of supported Operating systems with the Zabbix releases:

| Zabbix | 6.4 | 6.0 |
|---------------------|-----|-----|
| Red Hat Fam 9 | V | V |
| Red Hat Fam 8 | V | V |
| Ubuntu 24.04 noble | V | V |
| Ubuntu 22.04 jammy | V | V |
| Ubuntu 20.04 focal | V | V |
| Debian 12 bookworm | V | V |
| Debian 11 bullseye | V | V |
| Zabbix | 7.0 | 6.4 | 6.0 |
|---------------------|-----|-----|-----|
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Ubuntu 24.04 noble | V | V | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Debian 12 bookworm | V | V | V |
| Debian 11 bullseye | V | V | V |
| Suse Fam 15 | V | V | V |

# Installation

Expand All @@ -68,6 +69,10 @@ Please be aware that this role only installs the repo itself. It is generally u
* `zabbix_repo_yum_gpg_check`: Optional. Yum should check GPG keys. Default: 0
* `zabbix_repo_yum_gpg_key_url`: The URL to download the Zabbix GPG key from. Default: `http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD`
* `zabbix_repo_yum_schema`: Default: `https`. Option to change the web schema for the yum repository(http/https)
* `zabbix_repo_zypper`: A list with zypper repository configuration.
* `zabbix_repo_zypper_auto_import_keys`: Optional. Zypper should import GPG keys automatically. Default: true
* `zabbix_repo_zypper_disable_gpg_check`: Optional. Zypper shouldn't check GPG keys. Default: false
* `zabbix_repo_zypper_schema`: Default: `https`. Option to change the web schema for the zypper repository(http/https)

# Example Playbook

Expand Down
19 changes: 10 additions & 9 deletions docs/ZABBIX_SERVER_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@ ansible-galaxy collection install community.postgresql

See the following list of supported Operating systems with the Zabbix releases:

| Zabbix | 6.4 | 6.0 |
|---------------------|-----|-----|
| Red Hat Fam 9 | V | V |
| Red Hat Fam 8 | V | V |
| Ubuntu 24.04 noble | V | V |
| Ubuntu 22.04 jammy | V | V |
| Ubuntu 20.04 focal | V | V |
| Debian 12 bookworm | V | V |
| Debian 11 bullseye | V | V |
| Zabbix | 7.0 | 6.4 | 6.0 |
|---------------------|-----|-----|-----|
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Ubuntu 24.04 noble | V | V | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | | V | V |
| Debian 12 bookworm | V | V | V |
| Debian 11 bullseye | | V | V |
| Suse Fam 15 | V | V | V |

You can bypass this matrix by setting `enable_version_check: false`

Expand Down
3 changes: 2 additions & 1 deletion molecule/zabbix_agent_tests/common/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ platforms:
networks:
- name: zabbix
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
groups:
- agent
- ${MY_MOLECULE_VERSION:-v70}
Expand Down
12 changes: 10 additions & 2 deletions molecule/zabbix_agent_tests/common/playbooks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@
- ansible_os_family == 'Debian'

- name: "Installing packages on Suse family"
ansible.builtin.shell: zypper install -y python-xml python-libxml2 net-tools which
community.general.zypper:
name:
- python3-xml
- python3-libxml2
- net-tools
- iproute2
- which
state: present
register: zabbix_agent_prepare_packages_install
until: zabbix_agent_prepare_packages_install is succeeded
when: ansible_os_family == 'Suse'
when:
- ansible_os_family == 'Suse'
tags:
- skip_ansible_lint

Expand Down
10 changes: 3 additions & 7 deletions molecule/zabbix_agent_tests/common/tests/common/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@


def test_zabbixagent_running_and_enabled(host, zabbix_agent_service):
# Find out why this is not working for linuxmint and opensuse
if host.system_info.distribution not in ["linuxmint", "opensuse", "ubuntu"]:
assert zabbix_agent_service.is_running
assert zabbix_agent_service.is_enabled
assert zabbix_agent_service.is_running
assert zabbix_agent_service.is_enabled


def test_zabbix_agent_dot_conf(zabbix_agent_conf):
Expand All @@ -32,9 +30,7 @@ def test_zabbix_include_dir(zabbix_agent_include_dir):


def test_socket(host):
# Find out why this is not working for linuxmint and opensus
if host.system_info.distribution not in ["linuxmint", "opensuse"]:
assert host.socket("tcp://0.0.0.0:10050").is_listening
assert host.socket("tcp://0.0.0.0:10050").is_listening


# def test_zabbix_package(host, zabbix_agent_package):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@

@pytest.fixture
def zabbix_agent_conf(host):
if host.system_info.distribution in ["opensuse"]:
passwd = host.file("/etc/zabbix/zabbix-agentd.conf")
else:
passwd = host.file("/etc/zabbix/zabbix_agent2.conf")

return passwd
return host.file("/etc/zabbix/zabbix_agent2.conf")


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@

@pytest.fixture
def zabbix_agent_conf(host):
if host.system_info.distribution in ["opensuse"]:
passwd = host.file("/etc/zabbix/zabbix-agentd.conf")
else:
passwd = host.file("/etc/zabbix/zabbix_agent2.conf")

return passwd
return host.file("/etc/zabbix/zabbix_agent2.conf")


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@

@pytest.fixture
def zabbix_agent_conf(host):
if host.system_info.distribution in ["opensuse"]:
conf_file = host.file("/etc/zabbix/zabbix-agentd.conf")
else:
conf_file = host.file("/etc/zabbix/zabbix_agentd.conf")

return conf_file
return host.file("/etc/zabbix/zabbix_agentd.conf")


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@

@pytest.fixture
def zabbix_agent_conf(host):
if host.system_info.distribution in ["opensuse"]:
conf_file = host.file("/etc/zabbix/zabbix-agentd.conf")
else:
conf_file = host.file("/etc/zabbix/zabbix_agentd.conf")

return conf_file
return host.file("/etc/zabbix/zabbix_agentd.conf")


@pytest.fixture
def zabbix_agent_service(host):
if host.system_info.distribution == "opensuse-leap" and host.ansible.get_variables().get("zabbix_agent2", False):
return host.service("zabbix-agent2")
return host.service("zabbix-agent")


Expand Down
3 changes: 2 additions & 1 deletion molecule/zabbix_javagateway/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ platforms:
networks:
- name: zabbix
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
groups:
- ${MY_MOLECULE_VERSION:-v70}
provisioner:
Expand Down
17 changes: 14 additions & 3 deletions molecule/zabbix_javagateway/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
state: absent
regexp: "path-exclude=/usr/share/doc/*"
when:
- ansible_os_family != 'RedHat'
- ansible_os_family == 'Debian'

# https://github.com/geerlingguy/ansible-role-java/issues/64
- name: "Apt update"
ansible.builtin.shell: "apt-get update && mkdir -p /usr/share/man/man1"
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- ansible_os_family == 'Debian'

- name: "Installing packages on NON-CentOS"
ansible.builtin.apt:
Expand All @@ -46,4 +46,15 @@
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- ansible_os_family == 'Debian'

- name: "Installing packages on Suse"
community.general.zypper:
name:
- iproute2
- which
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family == 'Suse'
3 changes: 2 additions & 1 deletion molecule/zabbix_proxy/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ platforms:
networks:
- name: zabbix
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
groups:
- ${MY_MOLECULE_DATABASE:-mysql}
- ${MY_MOLECULE_VERSION:-v70}
Expand Down
Loading

0 comments on commit 6c694cd

Please sign in to comment.