]> arthur.barton.de Git - AnsibleRoles.git/blob - roles/apache2-php5/tasks/main.yml
Update "apt" tasks to use lists
[AnsibleRoles.git] / roles / apache2-php5 / tasks / main.yml
1 ---
2 # apache2-php5 tasks
3
4 - name: check if "php5-apcu" package exists
5   tags:
6     - apache
7     - packages
8   shell: apt-cache search php5-apcu | grep "^php5-apcu -" >/dev/null
9   check_mode: no
10   register: php5_apcu_is_available
11   failed_when: php5_apcu_is_available.rc > 1
12   changed_when: no
13
14 - name: install packages for Apache 2 with PHP 5
15   tags:
16     - apache
17     - packages
18   apt:
19     state: present
20     name: [
21       'libapache2-mod-php5',
22       'php5',
23       'php5-cli',
24       'php5-mysql',
25     ]
26   notify:
27     - restart "apache2"
28
29 - name: install "php5-apcu" cache
30   tags:
31     - apache
32     - packages
33   apt: >
34     state=present
35     name=php5-apcu
36   notify:
37     - restart "apache2"
38   when: php5_apcu_is_available.rc == 0
39
40 - name: install "php-apc" cache
41   tags:
42     - apache
43     - packages
44   apt: >
45     state=present
46     name=php-apc
47   notify:
48     - restart "apache2"
49   when: php5_apcu_is_available.rc != 0
50
51 - name: ensure service "apache2" is enabled and started
52   tags:
53     - apache
54     - services
55   service: >
56     enabled=yes
57     name=apache2
58     state=started