-
Notifications
You must be signed in to change notification settings - Fork 0
/
demeter.yml
122 lines (121 loc) · 3.48 KB
/
demeter.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
- hosts: demeter
become: yes
gather_facts: no
vars:
weave_env:
DOCKER_HOST: unix:///var/run/weave/weave.sock
tasks:
- file: path=/bin/weave state=absent
- get_url: url=https://git.io/weave dest=/bin/weave mode=777
- name: forward
shell: iptables -D FORWARD -j REJECT --reject-with icmp-host-prohibited
ignore_errors: yes
- name: input
shell: iptables -D INPUT -j REJECT --reject-with icmp-host-prohibited
ignore_errors: yes
- shell: iptables-save
- firewalld: port=9876/tcp permanent=true state=enabled zone=public
- firewalld: port=5432/tcp permanent=true state=enabled zone=public
- firewalld: port=3306/tcp permanent=true state=enabled zone=public
- firewalld: port=80/tcp permanent=true state=enabled zone=public
- service: name=docker state=restarted
- shell: weave launch
- name: setup mysql
environment: "{{weave_env}}"
docker:
name: mariadb
image: mariadb:latest
state: present
pull: always
volumes:
- "/srv/mariadb:/var/lib/mysql"
ports:
- "3306:3306"
restart_policy: always
restart_policy_retry: 5
cpu_set: 2-10
memory_limit: 8096MB
env:
MYSQL_ROOT_PASSWORD:
- copy: src=/home/qtheya/ansible/roles/selectel/demeter/my.cnf dest=/srv/my.cnf
- shell: docker cp /srv/my.cnf mariadb:/etc/mysql/my.cnf
- shell: docker commit mariadb
- name: start mysql
environment: "{{weave_env}}"
docker:
name: mariadb
image: mariadb:latest
state: started
- name: setup postgresql
environment: "{{weave_env}}"
docker:
name: postgresql
image: postgres:latest
state: started
pull: always
volumes:
- "/srv/postgresql:/var/lib/postgresql"
ports:
- "5432:5432"
restart_policy: always
restart_policy_retry: 5
cpu_set: 11-20
memory_limit: 8096MB
- name: setup nginx
environment: "{{weave_env}}"
docker:
name: nginx
image: nginx:latest
state: started
pull: always
volumes:
- "/storage/www:/var/www"
- "/srv/nginx/conf.d:/etc/nginx/conf.d"
- "/srv/nginx/nginx.conf:/etc/nginx/nginx.conf"
ports:
- "80:80"
- "443:443"
restart_policy: always
restart_policy_retry: 5
cpu_set: 8-12
memory_limit: 4048MB
- name: setup memcached
environment: "{{weave_env}}"
docker:
name: memcached
image: memcached:latest
state: started
pull: always
restart_policy: always
restart_policy_retry: 5
cpu_set: 21-22
memory_limit: 4048MB
- name: setup php5
environment: "{{weave_env}}"
docker:
name: php5fpm
image: php5/latest
state: started
pull: always
volumes:
- "/storage/www:/var/www"
restart_policy: always
restart_policy_retry: 5
cpu_set: 23-28
memory_limit: 8096MB
docker_api_version: 1.18
- name: setup php7
environment: "{{weave_env}}"
docker:
name: php7fpm
image: php7/latest
state: started
pull: always
volumes:
- "/storage/www:/var/www"
restart_policy: always
restart_policy_retry: 5
cpu_set: 29-34
memory_limit: 8096MB
docker_api_version: 1.18