]> arthur.barton.de Git - AnsibleRoles.git/blob - roles/apache2-php5/tasks/main.yml
apache2-php5, check-mk-agent: Fix warnings of ansible-lint(1)
[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: |
9     set -o pipefail
10     apt-cache search php5-apcu | grep "^php5-apcu -" >/dev/null
11   args:
12     executable: /bin/bash
13   check_mode: no
14   register: php5_apcu_is_available
15   failed_when: php5_apcu_is_available.rc > 1
16   changed_when: no
17
18 - name: install packages for Apache 2 with PHP 5
19   tags:
20     - apache
21     - packages
22   apt:
23     state: present
24     name: [
25       'libapache2-mod-php5',
26       'php5',
27       'php5-cli',
28       'php5-mysql',
29     ]
30   notify:
31     - restart "apache2"
32
33 - name: install "php5-apcu" cache
34   tags:
35     - apache
36     - packages
37   apt: >
38     state=present
39     name=php5-apcu
40   notify:
41     - restart "apache2"
42   when: php5_apcu_is_available.rc == 0
43
44 - name: install "php-apc" cache
45   tags:
46     - apache
47     - packages
48   apt: >
49     state=present
50     name=php-apc
51   notify:
52     - restart "apache2"
53   when: php5_apcu_is_available.rc != 0
54
55 - name: ensure service "apache2" is enabled and started
56   tags:
57     - apache
58     - services
59   service: >
60     enabled=yes
61     name=apache2
62     state=started