Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PHP7 install task #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
29 changes: 14 additions & 15 deletions LEMP/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ ubuntu_mysql_pkgs:
- libmysqlclient-dev

ubuntu_php_pkgs:
- php5-fpm
- php5-cgi
- php5-cli
- php5-curl
- php5-json
- php5-odbc
- php5-tidy
- php5-common
- php5-xmlrpc
- php5-gd
- php-pear
- php5-dev
- php5-imap
- php5-mcrypt
- php5-mysqlnd
- php7.0-common
- php7.0-cli
- php7.0-dev
- php7.0-fpm
- libpcre3-dev
- php7.0-gd
- php7.0-curl
- php7.0-imap
- php7.0-json
- php7.0-opcache
- php7.0-xml
- php7.0-mbstring
- php-sqlite3
- php-apcu

4 changes: 2 additions & 2 deletions LEMP/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name: mysql
state: restarted

- name: Restart PHP5-FPM
- name: Restart PHP7-FPM
service:
name: php5-fpm
name: php7.0-fpm
state: restarted
2 changes: 1 addition & 1 deletion LEMP/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- include: nginx.yml
- include: mysql.yml
- include: php5.yml
- include: php7.yml
- include: phpmyadmin.yml
23 changes: 23 additions & 0 deletions LEMP/tasks/php7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
- name: Install the PHP7 Repository
apt_repository:
repo: 'ppa:ondrej/php'
state: present

- name: Install PHP7-FPM
apt:
name: "{{ item }}"
state: latest
update_cache: yes
with_items: "{{ ubuntu_php_pkgs }}"

- name: Copy the templates to their respestive destination
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
group: root
with_items:
- { src: 'www.conf.j2', dest: '/etc/php/7.0/fpm/pool.d/www.conf' }
notify:
- Restart PHP7-FPM
2 changes: 1 addition & 1 deletion LEMP/templates/virtualhost.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ server {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
Expand Down
2 changes: 1 addition & 1 deletion LEMP/templates/www.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ user = www-data
group = www-data

; Note: This value is mandatory.
listen = /var/run/php5-fpm.sock
listen = /var/run/php/php7.0-fpm.sock

; Set permissions for unix socket.

Expand Down