diff --git a/README.md b/README.md index 9e50b35..fda1f0f 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,10 @@ Explicitly set PHP's date timezone system-wide. A list of the PHP packages to install (OS-specific by default). You'll likely want to install common packages like `php`, `php-cli`, `php-devel` and `php-pdo`, and you can add in whatever other packages you'd like (for example, `php-gd` for image manipulation, or `php-ldap` if you need to connect to an LDAP server for authentication). + php_enable_webserver: true + +If your usage of PHP is tied to a web server (e.g. Apache or Nginx), leave this default value. If you are using PHP server-side or to run some small application, set this value to `false` so this role doesn't attempt to interact with a web server. + php_webserver_daemon: "httpd" The default values for the HTTP server deamon are `httpd` (used by Apache) for RedHat/CentOS, or `apache2` (also used by Apache) for Debian/Ubuntu. If you are running another webserver (for example, `nginx`), change this value to the name of the daemon under which the webserver runs. diff --git a/defaults/main.yml b/defaults/main.yml index 6b3aa9b..e56faec 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -8,6 +8,7 @@ php_apc_cache_by_default: "1" php_apc_shm_size: "96M" php_date_timezone: "America/Chicago" php_packages: [] +php_enable_webserver: true php_webserver_daemon: "httpd" php_enable_php_fpm: false diff --git a/handlers/main.yml b/handlers/main.yml index c85d144..7ab83f7 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,6 +1,7 @@ --- - name: restart webserver service: "name={{ php_webserver_daemon }} state=restarted" + when: php_enable_webserver - name: restart php-fpm service: "name=php-fpm state=restarted"