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

integrate sles legacy init-script support #184

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
21 changes: 21 additions & 0 deletions roles/grafana/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@
update_cache: true
when: "(_grafana_dependencies | default())"

- name: "Prepare zypper"
when:
- "ansible_pkg_mgr == 'zypper'"
- "(grafana_manage_repo)"
environment: "{{ grafana_environment }}"
block:
- name: import Grafana RPM Key
ansible.builtin.rpm_key:
state: present
key: "{{ grafana_yum_key }}"

- name: "Add Grafana zypper repository"
community.general.zypper_repository:
name: grafana
description: grafana
repo: "{{ grafana_yum_repo }}"
enabled: true
disable_gpg_check : "{{ false if (grafana_yum_key) else omit }}"
runrefresh: true
when: "(not grafana_rhsm_repo)"

- name: "Prepare yum/dnf"
when:
- "ansible_pkg_mgr in ['yum', 'dnf']"
Expand Down
4 changes: 4 additions & 0 deletions roles/grafana/vars/distro/suse.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
---
grafana_package: "grafana{{ (grafana_version != 'latest') | ternary('-' ~ grafana_version, '') }}"
# https://unix.stackexchange.com/questions/534463/cant-enable-grafana-on-boot-in-fedora-because-systemd-sysv-install-missing
# applies to SuSe too
_grafana_dependencies:
- insserv-compat