]> arthur.barton.de Git - AnsibleRoles.git/blobdiff - roles/check-mk-agent/tasks/main.yml
ansible-lint: Fix "Octal file permissions must contain leading zero" warnings
[AnsibleRoles.git] / roles / check-mk-agent / tasks / main.yml
index 829b2604dd446e14e7eb01b6d35f981c5220bef3..e6f358501e6807e929e6fc6ff31a83538c339b49 100644 (file)
@@ -1,7 +1,7 @@
 ---
 # tasks file for check-mk-agent
 
-- name: install Debian packages for CheckMk agent
+- name: install Debian packages for Check_MK agent
   tags:
     - check_mk
     - monitoring
     - packages
   stat: path=/etc/systemd/system/check_mk.socket
   when: "ansible_distribution_major_version >= '8'"
+  check_mode: no
   register: check_mk_socket_unit
 
 - name: install systemd socket unit files
   tags:
+    - check_mk
     - packages
     - systemd
   template: >
     dest=/etc/systemd/system/check_mk.socket
     group=root
-    mode=644
+    mode=0644
     owner=root
     src=check_mk.socket.j2
-  when: "check_mk_socket_unit.stat.exists == False and ansible_distribution_major_version >= '8'"
+  when: ansible_distribution_major_version >= '8' and check_mk_socket_unit.stat.exists == False
   notify:
     - reload systemd daemon
 
 - name: install systemd service unit files
   tags:
+    - check_mk
     - packages
     - systemd
   template: >
     dest=/etc/systemd/system/check_mk@.service
     group=root
-    mode=644
+    mode=0644
     owner=root
     src=check_mk@.service.j2
-  when: "check_mk_socket_unit.stat.exists == False and ansible_distribution_major_version >= '8'"
+  when: ansible_distribution_major_version >= '8' and check_mk_socket_unit.stat.exists == False
+  notify:
+    - reload systemd daemon
+
+- name: enable xinetd configuration
+  tags:
+    - check_mk
+  lineinfile: >
+    dest=/etc/xinetd.d/check_mk
+    group=root
+    mode=0644
+    owner=root
+    regexp="^[\s]*disable[\s]*="
+    state=absent
+  when: "ansible_distribution_major_version < '8'"
   notify:
-    - "reload systemd daemon"
+    - restart "xinetd"
 
 - meta: flush_handlers
   tags:
     - packages
     - systemd
 
-- name: ensure "check_mk.socket" is enabled and running
+- name: ensure "check_mk.socket" is enabled and started
   tags:
     - check_mk
     - monitoring
   service: >
     enabled=yes
     name=check_mk.socket
-    state=running
+    state=started
   when: "ansible_distribution_major_version >= '8'"