]> arthur.barton.de Git - AnsibleRoles.git/commitdiff
apache2-php5, check-mk-agent: Fix warnings of ansible-lint(1)
authorAlexander Barton <alex@barton.de>
Tue, 23 Apr 2019 14:41:22 +0000 (16:41 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 23 Apr 2019 14:41:22 +0000 (16:41 +0200)
- 306: Shells that use pipes should set the pipefail option
- 601 Don't compare to literal True/False

roles/apache2-php5/tasks/main.yml
roles/check-mk-agent/tasks/main.yml

index 1fa104868a0ec398e3c15b21e51891cca74a9a95..5946f003670e39a61d1a0c5a1df1981644cd5739 100644 (file)
@@ -5,7 +5,11 @@
   tags:
     - apache
     - packages
-  shell: apt-cache search php5-apcu | grep "^php5-apcu -" >/dev/null
+  shell: |
+    set -o pipefail
+    apt-cache search php5-apcu | grep "^php5-apcu -" >/dev/null
+  args:
+    executable: /bin/bash
   check_mode: no
   register: php5_apcu_is_available
   failed_when: php5_apcu_is_available.rc > 1
index 0e59f1872966e856cd080eae8c561d8bd08d2dac..65b2a06fb50ec9ae5589bfe1706eb493104f13b2 100644 (file)
@@ -45,7 +45,7 @@
     mode=0644
     owner=root
     src=check_mk.socket.j2
-  when: ansible_distribution_major_version|int >= 8 and check_mk_socket_unit.stat.exists == False
+  when: ansible_distribution_major_version|int >= 8 and not check_mk_socket_unit.stat.exists
   notify:
     - reload systemd daemon
 
@@ -60,7 +60,7 @@
     mode=0644
     owner=root
     src=check_mk@.service.j2
-  when: ansible_distribution_major_version|int >= 8 and check_mk_socket_unit.stat.exists == False
+  when: ansible_distribution_major_version|int >= 8 and check_mk_socket_unit.stat.exists
   notify:
     - reload systemd daemon