Skip to content

Commit

Permalink
Merge pull request #5 from tokyowizard/debian
Browse files Browse the repository at this point in the history
Debian support
  • Loading branch information
MiLk authored Aug 3, 2016
2 parents c740f60 + 9ea12ea commit 7eb95d7
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 4 deletions.
8 changes: 8 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ galaxy_info:
versions:
- 6
- 7
- name: Debian
versions:
- wheezy
- jessie
categories:
- development
- web
Expand All @@ -21,4 +25,8 @@ dependencies:
centos7:
- epel
- remi
wheezy:
- dotdeb
jessie:
- dotdeb
- role: AerisCloud.yum
7 changes: 4 additions & 3 deletions tasks/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@

- name: "Set php facts"
set_fact:
php_fpm_service: php{{ php_version | replace('.','') }}-php-fpm
php_config_dir: /etc/opt/remi/php{{ php_version | replace('.','') }}
php_fpm_service: "php{{ php_version | replace('.','') }}-php-fpm"
php_config_dir: "/opt/remi/php{{ php_version | replace('.','') }}/root/etc"
php_fpm_config_d_dir: "/opt/remi/php{{ php_version | replace('.','') }}/root/etc/php-fpm.d"
tags:
- php
- name: "Set php facts"
set_fact:
php_config_dir: /opt/remi/php{{ php_version | replace('.','') }}/root/etc
php_config_dir: "/opt/remi/php{{ php_version | replace('.','') }}/root/etc"
when: php_version | version_compare('7.0', '<')
tags:
- php
Expand Down
47 changes: 47 additions & 0 deletions tasks/debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
- name: "Install PHP with php-fpm"
apt: >
name={{ item }}
state=latest
with_items:
- php{{ php_version | int }}-apcu
- php{{ php_version | int }}-cli
- php{{ php_version | int }}-fpm
- php{{ php_version | int }}-mysqlnd
- php{{ php_version | int }}-pgsql
notify:
- Restart php-fpm
tags:
- php
- pkgs

- name: "DEBUG Install custom PHP extensions"
debug: >
name="{{ php_custom_extensions|map('replace','',('php%s' % ( php_version|int )) + '-', 1)|join(',') }}"
state=latest
when: php_custom_extensions|length > 0
notify:
- Restart php-fpm
tags:
- php
- pkgs

- name: "Install custom PHP extensions"
apt: >
name="{{ php_custom_extensions|map('replace','',('php%s' % ( php_version|int )) + '-', 1)|join(',') }}"
state=latest
when: php_custom_extensions|length > 0
notify:
- Restart php-fpm
tags:
- php
- pkgs

- name: "Set php facts"
set_fact:
php_fpm_user: www-data
php_fpm_group: www-data
php_fpm_service: "php{{ php_version | int }}-fpm"
php_config_dir: "/etc/php{{ php_version | int }}/fpm"
php_fpm_config_d_dir: "/etc/php{{ php_version | int }}/fpm/pool.d"
tags:
- php
5 changes: 4 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- include: debian.yml
when: ansible_distribution == 'Debian'

- include: centos.yml
when: ansible_distribution == 'CentOS'

Expand All @@ -20,7 +23,7 @@
- name: "Set the php-fpm configuration"
template: >
src=www.conf
dest={{ php_config_dir }}/php-fpm.d/www.conf
dest={{ php_fpm_config_d_dir }}/www.conf
notify:
- Restart php-fpm
tags:
Expand Down

0 comments on commit 7eb95d7

Please sign in to comment.