-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathmain.yml
More file actions
65 lines (52 loc) · 2.25 KB
/
Copy pathmain.yml
File metadata and controls
65 lines (52 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
- set_fact: php_version_installed={{ php_version | float }}
- fail: msg="PHP7.0 is only available from Debian Jessie (8) on"
when: "ansible_lsb.major_release|int < 8 and php_version_installed is version_compare('7.0', '>=')"
- include: ubuntu-repo.yml
when: ansible_distribution == 'Ubuntu'
- include: debian-repo.yml
when: ansible_distribution == 'Debian' and php_version_installed is version_compare('5.5', '>')
# we do include_vars twice so that we can have default values
# and just have to override any changes in the specific versions
- include_vars: "default.yml"
- name: Include subconfiguration for php based on the distribution used
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_release }}-php.yml"
- "{{ ansible_distribution }}-{{ ansible_distribution_release }}-php{{ php_version_installed }}.yml"
- "{{ ansible_distribution }}-{{ ansible_distribution_release }}-php{{ php_version_installed | int }}.x.yml"
- "{{ ansible_distribution }}-php{{ php_version_installed }}.yml"
- "{{ ansible_distribution }}-php{{ php_version_installed | int }}.x.yml"
- "{{ ansible_distribution }}-default.yml"
- "default.yml"
- set_fact: php_phpenmod={{ phpenmod }}
- name: install PHP packages
apt: pkg={{ php_packages }} state=latest
become: yes
- name: install mysql database driver
apt: pkg={{ php_mysql_packages }} state=latest
become: yes
when: database_type|default(false) == 'mysql'
- name: install postgresql database driver
apt: pkg={{ php_pgsql_package }} state=latest
become: yes
when: database_type|default(false) == 'postgresql'
- name: Place PHP configuration files in place.
template: src={{ item.src }} dest={{ item.dest }} owner=root group=root mode=644
become: yes
with_items:
- { src: php.ini.j2, dest: "{{ etc_php_path }}/mods-available/php-dev.ini" }
- name: Activate PHP configuration files
command: "{{phpenmod}} {{ item }}"
with_items:
- php-dev
- imagick
become: yes
- name: set php alternative to the correct path
alternatives: name=php path={{ alternatives_php_path }}
become: yes
- name: Download php-cs-fixer
get_url:
url: http://get.sensiolabs.org/php-cs-fixer.phar
dest: /usr/local/bin/php-cs-fixer
mode: 0755
become: yes