-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.sls.github
45 lines (40 loc) · 1.1 KB
/
init.sls.github
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
#初始化运行目录
init_dir:
file:
- absent
- name: /tmp/collect_service_ip_port_to_yed/
run_dir:
file.directory:
- name: /tmp/collect_service_ip_port_to_yed/
- user: root
- group: root
- dir_mode: 755
- file_mode: 644
- recurse:
- user
- group
- mode
- ignore_dirs
- require:
- file: init_dir
collect2yed_git:
git.latest:
- name: https://github.com/talenhao/collect_service_ip_port_to_yed.git
- target: /tmp/collect_service_ip_port_to_yed/
- force_reset: True
- require:
- file: run_dir
yed_collect_agent:
cmd.run:
- name: if test -f /var/local/python2.7.13/bin/python ; then RUNPYTHON=/var/local/python2.7.13/bin/python ; else RUNPYTHON=python ; fi && $RUNPYTHON yed_collect_agent.py -c yed_collect.conf|tee /tmp/collect_service_ip_port_to_yed.log.$(date +%F.%T)
- cwd: /tmp/collect_service_ip_port_to_yed
- timeout: 82800
- user: root
- require:
- git: collect2yed_git
rm_files:
file:
- absent
- name: /tmp/collect_service_ip_port_to_yed/
- require:
- cmd: yed_collect_agent