Browse Source

+

sys-systemd-and-upstart
Vladimir Smagin 7 months ago
commit
1cd5358027

+ 3
- 0
nginx+php-fpm7.1/ansible.cfg View File

@@ -0,0 +1,3 @@
1
+[defaults] 
2
+log_path=ansible.log
3
+nocows = 1

+ 26
- 0
nginx+php-fpm7.1/ansible.log View File

@@ -0,0 +1,26 @@
1
+2018-08-31 01:56:13,120 p=31436 u=vlad |   ____________
2
+< PLAY [all] >
3
+ ------------
4
+        \   ^__^
5
+         \  (oo)\_______
6
+            (__)\       )\/\
7
+                ||----w |
8
+                ||     ||
9
+
10
+
11
+2018-08-31 01:56:13,152 p=31436 u=vlad |   ________________________
12
+< TASK [Gathering Facts] >
13
+ ------------------------
14
+        \   ^__^
15
+         \  (oo)\_______
16
+            (__)\       )\/\
17
+                ||----w |
18
+                ||     ||
19
+
20
+
21
+2018-08-31 01:56:13,928 p=31436 u=vlad |   [ERROR]: User interrupted execution
22
+
23
+2018-08-31 02:11:05,663 p=32090 u=vlad |  PLAY [all] *******************************************************************************************************************************************************************************************************************************************************************************************************************
24
+2018-08-31 02:11:05,677 p=32090 u=vlad |  TASK [Gathering Facts] *******************************************************************************************************************************************************************************************************************************************************************************************************
25
+2018-08-31 02:11:06,848 p=32090 u=vlad |   [ERROR]: User interrupted execution
26
+

+ 1
- 0
nginx+php-fpm7.1/deploy.retry View File

@@ -0,0 +1 @@
1
+10.0.2.46

+ 3
- 0
nginx+php-fpm7.1/deploy.sh View File

@@ -0,0 +1,3 @@
1
+#!/bin/bash
2
+
3
+ansible-playbook deploy.yml -i '10.0.2.46,' -T 30 -k -u root

+ 11
- 0
nginx+php-fpm7.1/deploy.yml View File

@@ -0,0 +1,11 @@
1
+---
2
+- hosts: all
3
+  gather_facts: True
4
+  vars: 
5
+    ansible_python_interpreter: /usr/bin/python3
6
+    #validate_certs: False
7
+
8
+  roles:
9
+    - preinstall
10
+    - php
11
+    - nginx

+ 16
- 0
nginx+php-fpm7.1/roles/nginx/tasks/main.yml View File

@@ -0,0 +1,16 @@
1
+---
2
+- name: Add an apt signing key for nginx and repository
3
+  apt_key:
4
+    url: http://nginx.org/keys/nginx_signing.key
5
+    state: present
6
+
7
+- apt_repository:
8
+    repo: deb http://nginx.org/packages/ubuntu/ {{ ansible_lsb.codename }} nginx
9
+    state: present
10
+    filename: nginx
11
+
12
+- name: Install nginx
13
+  apt: name=nginx state=present
14
+
15
+- name: Restart nginx
16
+  service: name=nginx state=restarted

+ 65
- 0
nginx+php-fpm7.1/roles/php/tasks/main.yml View File

@@ -0,0 +1,65 @@
1
+---
2
+- apt_repository:
3
+    validate_certs: False
4
+    repo: ppa:ondrej/php
5
+    state: present
6
+
7
+- name: Install php-fpm and deps
8
+  apt: name={{ item }} state=present update_cache=yes
9
+  with_items:
10
+    - php7.1
11
+    - php7.1-fpm
12
+    - php7.1-mbstring
13
+    - php7.1-xml
14
+    - php7.1-curl
15
+    - php7.1-pgsql
16
+    - php7.1-mysql
17
+    - php7.1-gd
18
+    - php7.1-zip
19
+    - php7.1-opcache
20
+    - php7.1-memcached
21
+
22
+- ini_file: 
23
+    path: /etc/php/7.1/fpm/pool.d/www.conf
24
+    section: www
25
+    option: user
26
+    value: www-data
27
+    backup: no
28
+
29
+- ini_file:
30
+    path: /etc/php/7.1/fpm/pool.d/www.conf
31
+    section: www
32
+    option: group
33
+    value: www-data
34
+    backup: no
35
+
36
+- ini_file: 
37
+    path: /etc/php/7.1/fpm/php.ini
38
+    section: PHP
39
+    option: short_open_tag
40
+    value: "On"
41
+    backup: no
42
+
43
+- ini_file: 
44
+    path: /etc/php/7.1/fpm/php.ini
45
+    section: PHP
46
+    option: max_execution_time
47
+    value: 300
48
+    backup: no
49
+
50
+- ini_file: 
51
+    path: /etc/php/7.1/fpm/php.ini
52
+    section: PHP
53
+    option: max_input_time
54
+    value: 300
55
+    backup: no
56
+
57
+- ini_file: 
58
+    path: /etc/php/7.1/fpm/php.ini
59
+    section: PHP
60
+    option: memory_limit
61
+    value: 512M
62
+    backup: no
63
+
64
+- name: Restart php-fpm
65
+  service: name=php7.1-fpm state=restarted

+ 12
- 0
nginx+php-fpm7.1/roles/preinstall/tasks/main.yml View File

@@ -0,0 +1,12 @@
1
+---
2
+- name: Ensure packages are installed
3
+  apt: name={{ item }} state=present update_cache=yes
4
+  with_items:
5
+    - python
6
+    - mc
7
+    - htop 
8
+    - iotop
9
+    - wget
10
+    - curl
11
+- set_fact: 
12
+    ansible_python_interpreter: /usr/bin/python

Loading…
Cancel
Save