main.yml
1.02 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
---
# tasks file for openresty
# make sure path exist
- stat:
path: "{{ path }}"
register: stat_result
- fail:
msg: " openresty {{ path }} not exist!"
when: stat_result.stat.exists == False
# make sure vaviable exist
- name: make sure varivable exists
fail:
msg: "{{ item }} not exits!"
when: "{{item}} == ''"
with_items:
- nameservers
# make sure group exists
- name: make sure groups exist in inventory file
fail:
msg: "group {{ item }} not exist!"
when: item not in groups
with_items:
- java-nginx
- java-gateway
- java-brower
- java-wechat
- java-activity
- java-erpgateway
- java-union
- name: copy lualib files to openresty
copy:
src: lualib/resty/
dest: "{{ path }}/lualib/resty/"
- name: copy yoho conf files to openresty
copy:
src: nginx/conf/
dest: "{{ path }}/nginx/conf/"
- name: update nginx upstream for file -nginx.conf
template:
src: nginx.conf.j2
dest: "{{ path }}/nginx/conf/nginx.conf"
notify:
- reload nginx