-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinkscope.yaml
More file actions
217 lines (175 loc) · 5.65 KB
/
Copy pathinkscope.yaml
File metadata and controls
217 lines (175 loc) · 5.65 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
- hosts: inkscope
become: yes
tasks:
- include_vars:
dir: vars
- include_vars:
file: "vars_specific/apache2.{{ ansible_os_family }}.yaml"
- name: 1a - Installing python
package:
name: python
state: latest
- name: 1b (RedHat) - Installing python-devel
package:
name: python-devel
state: latest
when: ansible_os_family == 'RedHat'
- name: 1b (Debian) - Installing python-dev
package:
name: python-dev
state: latest
when: ansible_os_family == 'Debian'
- name: 2 - Creating inkscope directory for logs
file:
path: "{{ inkscope_log_dir }}"
state: directory
owner: root
group: root
mode: 0777
- name: 3a - Installing git
package:
name: git
state: latest
- name: 3b - Fetching Inkscope files from Github
git:
repo: https://github.com/inkscope/inkscope
dest: "{{ working_dir }}"
- name: 3c - Getting Inkscope last commit date
shell: git log -1 --format=%cD
args:
chdir: "{{ working_dir }}"
register: last_commit_result
- block:
- name: 4a (RedHat) - Installing MongoDB-server
package:
name: mongodb-server
state: latest
- name: 4b (RedHat) - Enabling MongoDB-server
service:
name: mongod
enabled: yes
- name: 4c (RedHat) - Starting MongoDB-server
service:
name: mongod
state: started
- name: 4d (RedHat) - Installing MongoDB-client
package:
name: mongodb
state: latest
when: mongodb_location == 'local' and ansible_os_family == 'RedHat'
- name: 4 (Debian) - Installing, enabling and starting MongoDB
package:
name: mongodb
state: latest
when: mongodb_location == 'local' and ansible_os_family == 'Debian'
- name: 5 - Installing gcc
package:
name: gcc
state: latest
- name: 6 - Installing python-pip
include_role:
name: geerlingguy.pip
- name: 7 - Installing python modules
pip:
requirements: "{{ working_dir }}/requirements.txt"
state: present
- name: 8a - Creating /var/www
file:
path: "/var/www"
state: directory
owner: root
group: root
mode: 0755
- name: 8b - Creating /var/www/inkscope
file:
path: "/var/www/inkscope"
state: directory
owner: root
group: root
mode: 0755
- name: 9a - Copying inkscope files to /var/www/inkscope
command: "cp -R {{ working_dir }}/inkscopeViz/ /var/www/inkscope"
- name: 9b - Copying inkscope files to /var/www/inkscope
command: "cp -R {{ working_dir }}/inkscopeCtrl/ /var/www/inkscope"
- name: 9c - Copying inkscope files to /var/www/inkscope
command: "cp -R {{ working_dir }}/index.html /var/www/inkscope/index.html"
- name: 10 - Creating inkscope.conf
template:
src: ./templates/inkscope.conf.j2
dest: "{{ working_dir }}/inkscope.conf"
owner: root
group: root
mode: 0644
backup: yes
- name: 11 - Installing apache2 and dependencies
include_role:
name: geerlingguy.apache
- name: 12a - Creating /opt/inkscope
file:
path: "/opt/inkscope"
state: directory
owner: root
group: root
mode: 0755
- name: 12b - Creating /opt/inkscope/etc
file:
path: "/opt/inkscope/etc"
state: directory
owner: root
group: root
mode: 0755
- name: 12c - Copying inkscope.conf to /opt/inkscope/etc
command: "cp -R {{ working_dir }}/inkscope.conf /opt/inkscope/etc"
- name: 12d - Creating /opt/inkscope/bin
file:
path: "/opt/inkscope/bin"
state: directory
owner: root
group: root
mode: 0755
- name: 13a - Verifying Ceph presence
shell: ceph --version
- name: 13b - Verifying Ceph configuration file presence
stat:
path: "{{ ceph_conf }}"
register: result
failed_when: "result.stat.exists == False"
- name: 13c - Creating keyring for RestApi
shell: "ceph auth get-or-create client.restapi mds 'allow' osd 'allow *' mon 'allow *' > /etc/ceph/{{ cluster }}.client.restapi.keyring"
- name: 13d - Modifying Ceph configuration file
blockinfile:
dest: "{{ ceph_conf }}"
block: "{{ lookup('template', 'templates/ceph.conf.j2') }}"
state: present
- name: 14 (RedHat) - Restarting Apache
service:
name: httpd
state: restarted
when: ansible_os_family == 'RedHat'
- name: 14 (Debian) - Restarting Apache
service:
name: apache2
state: restarted
when: ansible_os_family == 'Debian'
- name: 15a - Copying cephprobe.py to /opt/inkscope/bin
command: "cp -Rp {{ working_dir }}/inkscopeProbe/cephprobe.py /opt/inkscope/bin"
- name: 15b - Copying daemon.py to /opt/inkscope/bin
command: "cp -Rp {{ working_dir }}/inkscopeProbe/daemon.py /opt/inkscope/bin"
- name: 15c - Creating Cephprobe service (link for cephprobe.py)
file:
path: /etc/init.d/cephprobe
src: /opt/inkscope/bin/cephprobe.py
state: link
- name: 15d - Creating Cephprobe service (link for daemon.py)
file:
path: /etc/init.d/daemon.py
src: /opt/inkscope/bin/daemon.py
state: link
- name: 15e - Enabling Cephprobe service
service:
name: cephprobe
enabled: yes
- name: 15f - Starting Cephprobe service
shell: service cephprobe restart
args:
warn: no