X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=roles%2Fapache2-php5%2Ftasks%2Fmain.yml;h=5946f003670e39a61d1a0c5a1df1981644cd5739;hb=6a985804768b569b80cb3f16709f91301cb5bb5f;hp=aead05e190d19663dbf5d338ebb3513f23dc6a04;hpb=2814233822a1579c86247603a030826cbf6798c5;p=AnsibleRoles.git diff --git a/roles/apache2-php5/tasks/main.yml b/roles/apache2-php5/tasks/main.yml index aead05e..5946f00 100644 --- a/roles/apache2-php5/tasks/main.yml +++ b/roles/apache2-php5/tasks/main.yml @@ -1,30 +1,62 @@ --- # apache2-php5 tasks +- name: check if "php5-apcu" package exists + tags: + - apache + - packages + shell: | + set -o pipefail + apt-cache search php5-apcu | grep "^php5-apcu -" >/dev/null + args: + executable: /bin/bash + check_mode: no + register: php5_apcu_is_available + failed_when: php5_apcu_is_available.rc > 1 + changed_when: no + - name: install packages for Apache 2 with PHP 5 + tags: + - apache + - packages + apt: + state: present + name: [ + 'libapache2-mod-php5', + 'php5', + 'php5-cli', + 'php5-mysql', + ] + notify: + - restart "apache2" + +- name: install "php5-apcu" cache + tags: + - apache + - packages + apt: > + state=present + name=php5-apcu + notify: + - restart "apache2" + when: php5_apcu_is_available.rc == 0 + +- name: install "php-apc" cache tags: - apache - packages apt: > - state=installed - name={{ item }} - with_items: - - apache2-mpm-prefork - - apache2-utils - - apachetop - - libapache2-mod-php5 - - php-apc - - php5 - - php5-cli - - php5-mysql + state=present + name=php-apc notify: - restart "apache2" + when: php5_apcu_is_available.rc != 0 -- name: ensure service "apache2" is enabled and running +- name: ensure service "apache2" is enabled and started tags: - apache - services service: > enabled=yes - name=autofs - state=running + name=apache2 + state=started