From f00951fe73496f29155074ebf9808248417e22e1 Mon Sep 17 00:00:00 2001 From: Vlad von Hraban Date: Mon, 22 May 2023 14:50:07 +0700 Subject: [PATCH] Do not run php-fpm when ansible is in check mode --- handlers/main.yml | 1 + tasks/configure-fpm.yml | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/handlers/main.yml b/handlers/main.yml index e0d0a29..b6f2513 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -13,3 +13,4 @@ when: - php_enable_php_fpm - php_fpm_state == 'started' + - not ansible_check_mode diff --git a/tasks/configure-fpm.yml b/tasks/configure-fpm.yml index 2813520..c9860bf 100644 --- a/tasks/configure-fpm.yml +++ b/tasks/configure-fpm.yml @@ -50,4 +50,7 @@ name: "{{ php_fpm_daemon }}" state: "{{ php_fpm_state }}" enabled: "{{ php_fpm_enabled_on_boot }}" - when: php_enable_php_fpm and ansible_distribution != "Debian" + when: + - php_enable_php_fpm + - ansible_distribution != "Debian" + - not ansible_check_mode