]> arthur.barton.de Git - AnsibleRoles.git/blobdiff - roles/check-mk-agent/tasks/main.yml
check-mk-agent: Fix detection of non-systemd-enabled hosts
[AnsibleRoles.git] / roles / check-mk-agent / tasks / main.yml
index 829b2604dd446e14e7eb01b6d35f981c5220bef3..4b36238be21c73695b212c94effc2d747c7933ea 100644 (file)
@@ -25,6 +25,7 @@
 
 - name: install systemd socket unit files
   tags:
+    - check_mk
     - packages
     - systemd
   template: >
     mode=644
     owner=root
     src=check_mk.socket.j2
-  when: "check_mk_socket_unit.stat.exists == False and ansible_distribution_major_version >= '8'"
+  when: "check_mk_socket_unit is defined and check_mk_socket_unit.stat.exists == False and ansible_distribution_major_version >= '8'"
   notify:
     - reload systemd daemon
 
 - name: install systemd service unit files
   tags:
+    - check_mk
     - packages
     - systemd
   template: >
@@ -47,9 +49,9 @@
     mode=644
     owner=root
     src=check_mk@.service.j2
-  when: "check_mk_socket_unit.stat.exists == False and ansible_distribution_major_version >= '8'"
+  when: "check_mk_socket_unit is defined and check_mk_socket_unit.stat.exists == False and ansible_distribution_major_version >= '8'"
   notify:
-    - "reload systemd daemon"
+    - reload systemd daemon
 
 - meta: flush_handlers
   tags: