From 06d8a0edd28b36704aa17730d85ad22986f7902b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 12 Oct 2016 15:25:11 -0500 Subject: [PATCH] Add the ability to choose --no-install-recommends for apt installs. --- README.md | 4 ++++ defaults/main.yml | 3 +++ tasks/setup-Debian.yml | 1 + 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 8ee4445..d505a73 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,10 @@ The default values for the HTTP server deamon are `httpd` (used by Apache) for R If you have enabled any additional repositories such as [geerlingguy.repo-epel](https://github.com/geerlingguy/ansible-role-repo-epel) or [geerlingguy.repo-remi](https://github.com/geerlingguy/ansible-role-repo-remi), you may want an easy way to swap PHP versions on the fly. By default, this is set to 'installed'. You can now override this variable to 'latest'. Combined with php_enablerepo, a user now doesn't need to manually uninstall the existing PHP packages before installing them from a different repository. + php_install_recommends: '' + +(Debian/Ubuntu only) Whether to install recommended packages when installing `php_packages`; you might want to set this to `no` explicitly if you're installing a PPA that recommends certain packages you don't want (e.g. Ondrej's `php` PPA will install `php7.0-cli` if you install `php-pear` alongside `php5.6-cli`... which is often not desired!). + php_executable: "php" The executable to run when calling PHP from the command line. You should only change this if running `php` on your server doesn't target the correct executable, or if you're using software collections on RHEL/CentOS and need to target a different version of PHP. diff --git a/defaults/main.yml b/defaults/main.yml index 539903a..6e6be80 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,6 +7,9 @@ php_enablerepo: "" # you want to upgrade or switch versions using a new repo. php_packages_state: installed +# Whether to install recommended packages. Used only for Debian/Ubuntu. +php_install_recommends: '' + # Set this to false if you're not using PHP with Apache/Nginx/etc. php_enable_webserver: true diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index f77278a..26b096a 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -6,6 +6,7 @@ apt: name: "{{ item }}" state: "{{ php_packages_state }}" + install_recommends: "{{ php_install_recommends | default(omit) }}" with_items: "{{ php_packages }}" register: php_package_install notify: restart webserver