From e9d5dedc70276305dab7a95b929606196ab0be31 Mon Sep 17 00:00:00 2001 From: Felix Peters Date: Fri, 6 Feb 2015 13:21:51 +0100 Subject: [PATCH] Fix #25 Get installed version of Apache. failed Add absolute path for apache/httpd to avoid command not found error --- tasks/main.yml | 2 +- vars/Debian.yml | 1 + vars/RedHat.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index d6cdb61..a318c7b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -17,7 +17,7 @@ # Figure out what version of Apache is installed. - name: Get installed version of Apache. - command: "{{ apache_daemon }} -v" + shell: "{{apache_daemon_path}}{{ apache_daemon }} -v" changed_when: false always_run: yes register: _apache_version diff --git a/vars/Debian.yml b/vars/Debian.yml index d91ad0a..59cd7c3 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -1,5 +1,6 @@ --- apache_daemon: apache2 +apache_daemon_path: /usr/sbin/ apache_server_root: /etc/apache2 apache_conf_path: /etc/apache2 diff --git a/vars/RedHat.yml b/vars/RedHat.yml index 607c3ff..8911b3d 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -1,5 +1,6 @@ --- apache_daemon: httpd +apache_daemon_path: /usr/sbin/ apache_server_root: /etc/httpd apache_conf_path: /etc/httpd/conf.d