mirror of
https://github.com/geerlingguy/ansible-role-php.git
synced 2025-01-24 21:41:21 +01:00
Merge pull request #135 from geerlingguy/pporada-gl-master
Enable user to set the apt/yum module 'state'
This commit is contained in:
commit
6c7eb71a01
@ -30,6 +30,10 @@ The default values for the HTTP server deamon are `httpd` (used by Apache) for R
|
||||
|
||||
(RedHat/CentOS only) If you have enabled any additional repositories (might I suggest [geerlingguy.repo-epel](https://github.com/geerlingguy/ansible-role-repo-epel) or [geerlingguy.repo-remi](https://github.com/geerlingguy/ansible-role-repo-remi)), those repositories can be listed under this variable (e.g. `remi-php70,epel`). This can be handy, as an example, if you want to install the latest version of PHP 7.0, which is in the Remi repository.
|
||||
|
||||
php_packages_state: "installed"
|
||||
|
||||
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_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.
|
||||
|
@ -2,6 +2,9 @@
|
||||
# Pass in a comma-separated list of repos to use (e.g. "remi,epel").
|
||||
php_enablerepo: ""
|
||||
|
||||
# State that the system package installer should use for PHP the enabled repo (e.g. "installed,latest")
|
||||
php_packages_state: installed
|
||||
|
||||
# Set this to false if you're not using PHP with Apache/Nginx/etc.
|
||||
php_enable_webserver: true
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
- name: Ensure PHP packages are installed.
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
state: installed
|
||||
state: "{{ php_packages_state }}"
|
||||
with_items: "{{ php_packages }}"
|
||||
register: php_package_install
|
||||
notify: restart webserver
|
||||
|
@ -2,7 +2,7 @@
|
||||
- name: Ensure PHP packages are installed.
|
||||
yum:
|
||||
name: "{{ item }}"
|
||||
state: installed
|
||||
state: "{{ php_packages_state }}"
|
||||
enablerepo: "{{ php_enablerepo }}"
|
||||
with_items: "{{ php_packages }}"
|
||||
notify: restart webserver
|
||||
|
Loading…
Reference in New Issue
Block a user