Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Feb 20, 2019
1 parent 85831c9 commit 30ecf8d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
18 changes: 18 additions & 0 deletions files/ubuntu/php70.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
server {
listen 80;
root /var/www/html/php71/root;
index index.php index.html index.htm index.nginx-debian.html;
server_name php71.sysadm.kz;
location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;

}
location ~ /\.ht {
deny all;
}
}
15 changes: 14 additions & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,24 @@
service: name=mysql state=started
when: ansible_os_family == "Debian"

- name: Install php modules 7.1/7.2/7.3
- name: Install php modules 7.0/7.1/7.2/7.3
apt:
name: "{{ packages }}"
vars:
packages:
- php7.0-common
- php7.0-cli
- php7.0-dev
- php7.0-fpm
- php7.0-gd
- php7.0-gdgd
- php7.0-curl
- php7.0-gd-imap
- php7.0-gd-json
- php7.0-opcache
- php7.0-xml
- php7.0-mbstring
- php7.0-sqlite3
- php7.1-common
- php7.1-cli
- php7.1-dev
Expand Down
16 changes: 15 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@
vars:
packages:
- nginx
- php7.0
- php7.1
- php7.2
- php7.3
- php7.0-fpm
- php7.1-fpm
- php7.2-fpm
- php7.3-fpm
notify: Install php modules 7.1/7.2/7.3
notify: Install php modules 7.0/7.1/7.2/7.3

- name: Creates directory /var/www/html/php73/root
file:
Expand All @@ -77,6 +79,12 @@
dest: /etc/nginx/sites-available/php73
become: yes

- name: copying nginx config file for php7.0
template:
src: /etc/ansible/roles/ansible-lemp/files/ubuntu/php70.j2
dest: /etc/nginx/sites-available/php70
become: yes

- name: copying nginx config file for php7.1
template:
src: /etc/ansible/roles/ansible-lemp/files/ubuntu/php71.j2
Expand All @@ -89,6 +97,12 @@
dest: /etc/nginx/sites-enabled/php71
state: link

- name: create symlink for php70
file:
src: /etc/nginx/sites-available/php70
dest: /etc/nginx/sites-enabled/php70
state: link

- shell: "php -n -v | head -n 1 | cut -d ' ' -f 2 | cut -d '.' -f 1,2"
register: php_version
- lineinfile:
Expand Down

0 comments on commit 30ecf8d

Please sign in to comment.