Users can now set the apt/yum module 'state' to be 'installed, latest, present' etc. This allows a user to test php55, swap a variable to enable the php56 repo, then re-run the ansible play to get different PHP packages.

This commit is contained in:
Phil Porada 2016-04-08 16:43:26 -04:00
parent 14eed984ef
commit f20bbde884
3 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,9 @@
# Pass in a comma-separated list of repos to use (e.g. "remi,epel"). # Pass in a comma-separated list of repos to use (e.g. "remi,epel").
php_enablerepo: "" php_enablerepo: ""
# State that the system package installer should use for PHP the enabled repo (e.g. "installed,latest")
php_repostate: installed
# Set this to false if you're not using PHP with Apache/Nginx/etc. # Set this to false if you're not using PHP with Apache/Nginx/etc.
php_enable_webserver: true php_enable_webserver: true

View File

@ -5,7 +5,7 @@
- name: Ensure PHP packages are installed. - name: Ensure PHP packages are installed.
apt: apt:
name: "{{ item }}" name: "{{ item }}"
state: installed state: "{{ php_repostate }}"
with_items: "{{ php_packages }}" with_items: "{{ php_packages }}"
register: php_package_install register: php_package_install
notify: restart webserver notify: restart webserver

View File

@ -2,7 +2,7 @@
- name: Ensure PHP packages are installed. - name: Ensure PHP packages are installed.
yum: yum:
name: "{{ item }}" name: "{{ item }}"
state: installed state: "{{ php_repostate }}"
enablerepo: "{{ php_enablerepo }}" enablerepo: "{{ php_enablerepo }}"
with_items: "{{ php_packages }}" with_items: "{{ php_packages }}"
notify: restart webserver notify: restart webserver