Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/suse support #273

Merged
merged 7 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions doc/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ collection. All features which are not configured will be disabled.

---

## Requirements

**Operatingsystems**:
For **OSFamily Suse** please make sure the Collection **community.general** is available.
Otherwise the modules **zypper_repository** and **zypper** are missing.

**Imports**:
If you want the collection roles to **import schemas and users to databases**, make sure
the client (**"mysql", "psql"**) for your database is available on your system.

## Installation

To start with the collection, easily install it with the **ansible-galaxy** command.
Expand Down
6 changes: 6 additions & 0 deletions roles/icinga2/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ galaxy_info:
license: Apache-2.0
min_ansible_version: 2.9
platforms:
- name: opensuse
versions:
- 15.5
- name: SLES
versions:
- 15
- name: EL
versions:
- 7
Expand Down
4 changes: 4 additions & 0 deletions roles/icinga2/tasks/features/idomysql/install_on_Suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Zypper - install package icinga2-ido-mysql
community.general.zypper:
name: icinga2-ido-mysql
state: present
4 changes: 4 additions & 0 deletions roles/icinga2/tasks/features/idopgsql/install_on_Suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Zypper - install package icinga2-ido-pgsql
community.general.zypper:
name: icinga2-ido-pgsql
state: present
5 changes: 0 additions & 5 deletions roles/icinga2/tasks/install_on_Suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@
name: icinga2-selinux
state: present
when: ansible_selinux is defined and ansible_selinux.status == "enabled"

- name: Zypper - install dep
community.general.zypper:
name: libboost_regex1_66_0
state: present
16 changes: 16 additions & 0 deletions roles/icinga2/vars/Suse-12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
icinga2_packages: ["icinga2","libboost_regex1_54_0"]
icinga2_user: icinga
icinga2_group: icinga
icinga2_config_path: /etc/icinga2
icinga2_log_path: /var/log/icinga2
icinga2_ca_path: /var/lib/icinga2/ca
icinga2_cert_path: /var/lib/icinga2/certs
icinga2_fragments_path: /var/tmp/icinga
icinga2_default_constants:
PluginDir: /usr/lib/nagios/plugins/
ManubulonPluginDir: /usr/lib/nagios/plugins/
PluginContribDir: /usr/lib/nagios/plugins/
NodeName: "{{ ansible_fqdn }}"
ZoneName: NodeName
TicketSalt: ''
2 changes: 1 addition & 1 deletion roles/icinga2/vars/Suse.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
icinga2_packages: ["icinga2"]
icinga2_packages: ["icinga2","libboost_regex1_66_0"]
icinga2_user: icinga
icinga2_group: icinga
icinga2_config_path: /etc/icinga2
Expand Down
4 changes: 4 additions & 0 deletions roles/icingadb/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ galaxy_info:
license: Apache-2.0
min_ansible_version: 2.9
platforms:
- name: opensuse
versions: ['15.5']
- name: SLES
versions: ['15']
- name: EL
versions: ['7']
- name: Debian
Expand Down
4 changes: 4 additions & 0 deletions roles/icingadb/tasks/install_on_suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Suse - Install IcingaDB packages
community.general.zypper:
name: "{{ icingadb_packages }}"
state: present
4 changes: 4 additions & 0 deletions roles/icingadb_redis/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ galaxy_info:
license: Apache-2.0
min_ansible_version: 2.9
platforms:
- name: opensuse
versions: ['15.5']
- name: SLES
versions: ['15']
- name: EL
versions: ['7']
- name: Debian
Expand Down
5 changes: 5 additions & 0 deletions roles/icingadb_redis/tasks/install_on_suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Suse - install icingadb packages
community.general.zypper:
name: "{{ icingadb_redis_packages }}"
state: present
4 changes: 4 additions & 0 deletions roles/icingaweb2/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ galaxy_info:
license: Apache-2.0
min_ansible_version: 2.9
platforms:
- name: opensuse
versions: ['15.5']
- name: SLES
versions: ['15']
- name: EL
versions: ['7','8']
- name: Debian
Expand Down
5 changes: 5 additions & 0 deletions roles/icingaweb2/tasks/install_on_suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Suse - Install Icinga Web 2 packages
community.general.zypper:
name: "{{ icingaweb2_packages }}"
state: present
4 changes: 2 additions & 2 deletions roles/icingaweb2/tasks/manage_icingaweb_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
when: icingaweb2_resources is defined

- name: Assemble roles.ini
when: icingaweb2_admin_password is defined or icingaweb2_roles is defined
when: icingaweb2_admin_username is defined and icingaweb2_admin_password is defined
block:
- name: Build variable
ansible.builtin.set_fact:
Expand All @@ -108,7 +108,7 @@
dest: "{{ icingaweb2_fragments_path }}/roles/roles_01"
owner: root
group: "{{ icingaweb2_group }}"
when: icingaweb2_admin_password is defined
when: icingaweb2_admin_username is defined and icingaweb2_admin_password is defined

- name: Build variable
ansible.builtin.set_fact:
Expand Down
4 changes: 4 additions & 0 deletions roles/icingaweb2/vars/suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
icingaweb2_httpd_user: wwwrun
icingaweb2_fragments_path: /var/tmp/icingaweb
icingaweb2_packages: ["icingaweb2", "icingacli"]
5 changes: 5 additions & 0 deletions roles/repos/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ icinga_repo_yum_snapshot_url: "http://packages.icinga.com/epel/$releasever/snaps
icinga_repo_yum_snapshot_key: "{{ icinga_repo_gpgkey }}"
icinga_repo_yum_snapshot_description: "ICINGA (snapshot release for epel)"

icinga_repo_zypper_key: "{{ icinga_repo_gpgkey }}"
icinga_repo_zypper_stable_url: "https://packages.icinga.com/openSUSE/$releasever/release/"
#icinga_repo_zypper_testing_url: ""
icinga_repo_zypper_snapshot_url: "https://packages.icinga.com/openSUSE/$releasever/snapshot/"

icinga_repo_apt_key: "{{ icinga_repo_gpgkey }}"
icinga_repo_apt_keyring: /etc/apt/keyrings/icinga-archive-keyring.asc
icinga_repo_apt_stable_deb: "deb [signed-by={{ icinga_repo_apt_keyring }}] http://packages.icinga.com/{{ ansible_distribution|lower }} icinga-{{ ansible_distribution_release|lower }} main"
Expand Down
6 changes: 6 additions & 0 deletions roles/repos/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ galaxy_info:
license: AGPL-3.0-only
min_ansible_version: 2.9
platforms:
- name: opensuse
versions:
- 15.5
- name: SLES
versions:
- 15
- name: EL
versions:
- 7
Expand Down
2 changes: 1 addition & 1 deletion roles/repos/tasks/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Apt - ensure apt keyrings directory
file:
ansible.builtin.file:
state: directory
path: /etc/apt/keyrings
owner: root
Expand Down
25 changes: 25 additions & 0 deletions roles/repos/tasks/Suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---

- name: Suse - add RPM key
ansible.builtin.rpm_key:
state: present
key: "{{ icinga_repo_zypper_key }}"

- name: Suse - add Icinga repository (stable)
community.general.zypper_repository:
name: icinga-stable-release
description: ICINGA (stable release for openSUSE)
state: "{{ 'present' if icinga_repo_stable|bool else 'absent' }}"
repo: "{{ icinga_repo_zypper_stable_url }}"

- name: Suse - add Icinga repository (testing)
ansible.builtin.fail:
msg: "Suse Testing repo is not available."
when: icinga_repo_testing|bool == true

- name: Suse - add Icinga repository (snapshot)
community.general.zypper_repository:
name: icinga-snapshot-builds
description: ICINGA (snapshot builds for openSUSE)
repo: "{{ icinga_repo_zypper_snapshot_url }}"
state: "{{ 'present' if icinga_repo_snapshot|bool else 'absent' }}"