Project

General

Profile

Review #702

ansible-role-httpd_php_fpm: improve check mode support

Added by Pierre-Louis Bonicoli 4 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Normal
Category:
-
Start date:
2020-07-01
Branch:
ansible-role-httpd_php_fpm@improve_check_mode_handling

Description

Repository/branch: ansible-role-httpd_php_fpm/improve_check_mode_handling

Improve check mode support:
  • check mode: handle apache2_module failure
  • don't check paths existence when check mode is enabled
  • Check mode: don't fail when php binary isn't installed
One unrelated change included:
  • Ensure php_minor_version var isn't empty

Related issues

Copied from DuckCorp Infrastructure - Review #701: ansible-role-zabbix: improve check mode supportResolved2020-07-01Actions
Copied to DuckCorp Infrastructure - Review #703: dc-web: improve check mode supportResolved2020-07-01Actions

History

#1

Updated by Pierre-Louis Bonicoli 4 months ago

  • Copied from Review #701: ansible-role-zabbix: improve check mode support added
#2

Updated by Pierre-Louis Bonicoli 4 months ago

Branch updated:
  • typo fixed (isfailed)
  • extraneous brackets removed
  • missing quotes added (due to a space being present after a colon)
  • expected error message fixed (command not found)
diff --git a/tasks/common.yml b/tasks/common.yml
index 3cc04b0..b7e019c 100644
--- a/tasks/common.yml
+++ b/tasks/common.yml
@@ -16,8 +16,8 @@
     - setenvif
   register: _httpd_php_fpm_apache2_module
   failed_when:
-  - '{{ _httpd_php_fpm_apache2_moduleis failed }}'
-  - "{{ not ansible_check_mode or 'Neither of apache2ctl nor apachctl found' not in _httpd_php_fpm_apache2_module.get('msg', '') }}" 
+    - _httpd_php_fpm_apache2_module is failed
+    -  not ansible_check_mode or 'Neither of apache2ctl nor apachctl found' not in _httpd_php_fpm_apache2_module.get('msg', '')
   notify: verify config and restart httpd

 - name: "Retrieve PHP FPM minor version #1" 
(1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? y
@@ -29,10 +29,12 @@
   changed_when: False
   failed_when:
     - php_minor_version_raw is failed
-    - not (ansible_check_mode and 'php: No such file or directory' in php_minor_version_raw.stderr)
+    - "not (ansible_check_mode and 'php: command not found' in php_minor_version_raw.stderr)" 
   register: php_minor_version_raw
   check_mode: no

 - name: "Retrieve PHP FPM minor version #2" 
   set_fact:
     php_minor_version: "{{ php_minor_version_raw.stdout }}" 
#3

Updated by Pierre-Louis Bonicoli 4 months ago

  • Copied to Review #703: dc-web: improve check mode support added
#4

Updated by Marc Dequènes 4 months ago

  • Status changed from In Progress to Resolved

Thanks a lot, merged.

#5

Updated by Pierre-Louis Bonicoli 4 months ago

  • Copied to Review #705: ansible-role-httpd_php_fpm: create Unix group used for pool workers added
#6

Updated by Pierre-Louis Bonicoli 4 months ago

  • Copied to deleted (Review #705: ansible-role-httpd_php_fpm: create Unix group used for pool workers)

Also available in: Atom PDF