-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathims-inject.yml
71 lines (63 loc) · 1.79 KB
/
ims-inject.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
- name: Inject working space code into local IMS
hosts:
- local-dev
environment: "{{ proxy_env }}"
pre_tasks:
- name: include vault vars
include_vars: ims_vault.yml
tasks:
- name: Create alternative project directory
file:
path: /var/projects/ebisc/ebisc-ims-inject
state: directory
owner: "{{ ansible_user }}"
become: yes
- name: inject source code
synchronize:
src: "{{ ims_inject_dir }}/"
dest: /var/projects/ebisc/ebisc-ims-inject
delete: yes
mode: push
rsync_opts:
- "--exclude=.git"
- "--exclude=media"
- "--exclude=var/media"
- name: build injected ims (uwsgi)
command: >
docker build
--file=Dockerfile-uwsgi
"--build-arg=ROLE={{ ims_role }}"
--build-arg=http_proxy=$http_proxy
--build-arg=https_proxy=$https_proxy
"--add-host={{ proxy_host }}"
--tag=ebisc/ims-uwsgi:latest
.
args:
chdir: /var/projects/ebisc/ebisc-ims-inject
- name: restart uwsgi
become: yes
systemd:
daemon_reload: yes
name: ims-uwsgi.service
state: restarted
- name: build ims nginx
docker_image:
path: /var/projects/ebisc/ebisc-ims-inject
dockerfile: Dockerfile-nginx
name: ebisc/ims-nginx
state: present
pull: yes # always get updated base image
force: yes # update/build even when an image exists
tag: latest
- name: restart ims-nginx
become: yes
systemd:
daemon_reload: yes
name: ims-nginx.service
state: restarted
- name: restart nginx
become: yes
systemd:
daemon_reload: yes
name: nginx.service
state: restarted