-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.yml
73 lines (70 loc) · 2.53 KB
/
server.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
- name: start the Server Playbook
hosts: all
become: yes
vars_files:
- vars/default.yml
vars_prompt:
- name: framework_option
prompt: "Which framework do you want to install (php/node/none)"
default: "none"
private: no
- name: database_option
prompt: "Which database system you want to install (mysql/mongodb/postgres/none)"
default: "none"
private: no
- name: webserver_option
prompt: "Which web server system you want to install (apache/nginx/none)"
default: "apache"
private: no
- name: redis_option
prompt: "Do you want to install redis (y/n)"
default: "n"
private: no
- name: supervisor_option
prompt: "Do you want to install supervisor (y/n)"
default: "n"
private: no
- name: elasticsearch_option
prompt: "Do you want to install Elasticsearch (y/n)"
default: "n"
private: no
- name: awstools_option
prompt: "Do you want to install AWS EC2 related tools(eg. mon-tools,agents etc.)"
default: "n"
private: no
- name: seconduser_option
prompt: "Do you want to create a second user without read access ?"
default: "n"
private: no
- name: ssl_option
prompt: "Do you want to install SSL certificates using LetsEncrypt and Certbot"
default: "n"
private: no
roles:
- system
- { role: apache, when: webserver_option == "apache" }
- { role: nginx, when: webserver_option == "nginx" }
- { role: php, when: framework_option == "php"}
- { role: node, when: framework_option == "node"}
- { role: mysql, when: database_option == "mysql" }
- { role: mongodb, when: database_option == "mongodb" }
- { role: postgres, when: database_option == "postgres" }
- { role: redis, when: redis_option == "y"}
- { role: supervisor, when: supervisor_option == "y"}
- { role: elasticsearch, when: elasticsearch_option == "y"}
- { role: awstools, when: awstools_option == "y" }
- { role: ssl, when: ssl_option == "y" }
- firewall
handlers:
- name: restart apache2
service: name=apache2 state=restarted
- name: restart nginx
service: name=nginx state=restarted
- name: restart mongodb
service: name=mongod state=restarted
- name: restart mysql
service: name=mysql state=restarted
- name: restart fail2ban
service: name=fail2ban state=restarted
- name: restart postgres
service: name=postgresql state=restarted