Skip to content
Snippets Groups Projects
Commit 6aae5d8d authored by Chris Croome's avatar Chris Croome
Browse files

Add systemd symlink

parent e3ed0fec
No related branches found
No related tags found
No related merge requests found
Pipeline #23947 passed
......@@ -27,7 +27,9 @@
- monitoring-plugins-systemd
state: present
default_release: "{{ ansible_distribution_release }}-backports"
when: icinga_plugin_systemd.rc == 0
when:
- ansible_distribution_release == "bullseye"
- icinga_plugin_systemd.rc == 0
- name: Bookworm packages present
ansible.builtin.apt:
......@@ -36,6 +38,34 @@
state: present
when: ansible_distribution_release is regex('^bookworm$')
- name: Check if /usr/lib/nagios/plugins/check_systemd exists
ansible.builtin.stat:
path: /usr/lib/nagios/plugins/check_systemd
register: icinga_plugin_systemd_file
- name: Check if /usr/lib/nagios/plugins/check_systemd.py exists
ansible.builtin.stat:
path: /usr/lib/nagios/plugins/check_systemd.py
register: icinga_plugin_systemd_symlink
when:
- icinga_plugin_systemd_file.stat.exists | bool
- icinga_plugin_systemd_file.stat.isreg | bool
- name: Symlink check_systemd.py to check_systemd
ansible.builtin.file:
state: link
src: /usr/lib/nagios/plugins/check_systemd
dest: /usr/lib/nagios/plugins/check_systemd.py
follow: false
mode: 0777
owner: root
group: root
when:
- icinga_plugin_systemd_file.stat.exists | bool
- icinga_plugin_systemd_file.stat.isreg | bool
- icinga_plugin_systemd_symlink is defined
- not icinga_plugin_systemd_symlink.stat.exists | bool
- name: Icinga package present
ansible.builtin.apt:
pkg:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment