-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.yml
48 lines (44 loc) · 1.11 KB
/
local.yml
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
---
- hosts: localhost
become: true
tasks:
- name: updates
apt:
name: "{{item}}"
state: latest
update_cache: yes
with_items:
- nginx
- php
- name: update nginx config
replace:
dest: /etc/nginx/sites-available/default
regexp: index index\.html index\.htm index\.nginx-debian\.html;
replace: index index.php index.html index.htm index.nginx-debian.html;
backup: yes
- name: further update nginx config
blockinfile:
dest: /etc/nginx/sites-available/default
insertafter: server_name _;
block: |
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php7.0-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
notify:
- restart services
- name: update index.php
copy:
src: ./index.php
dest: /var/www/html
handlers:
- name: restart services
service:
name: "{{item}}"
state: reloaded
with_items:
- nginx
- php7.0-fpm