]> 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 af00a038e41ec2132f83008a57107177982d032e..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
@@ -21,6 +21,7 @@
     - 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
   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 is defined and 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
 
   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 is defined and 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
 
@@ -59,7 +60,7 @@
   lineinfile: >
     dest=/etc/xinetd.d/check_mk
     group=root
-    mode=644
+    mode=0644
     owner=root
     regexp="^[\s]*disable[\s]*="
     state=absent
     - 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'"