-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.yml
51 lines (43 loc) · 1.15 KB
/
main.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
---
- name: "Remove {{ beat_name }} data directory"
file:
path: '{{ beat_data_path }}'
state: absent
- name: "Remove {{ beat_name }} logs directory"
file:
path: '{{ beat_logs_path }}'
state: absent
- name: "Pre-run setup for {{ beat_name }}"
include_tasks: '{{ pre_run_item }}'
with_first_found:
- files:
- 'tasks/{{ beat_name }}/pre-run.yml'
skip: true
loop_control:
loop_var: pre_run_item
- name: Replace configuration file with template
template:
src: '{{ beat_name }}.yml.j2'
dest: '{{ beat_cfg }}'
mode: 0600
- name: 'Start {{ beat_service_name }} service'
service:
name: '{{ beat_service_name }}'
state: restarted
- name: "Post-run setup for {{ beat_name }}"
include_tasks: '{{ post_run_item }}'
with_first_found:
- files:
- 'tasks/{{ beat_name }}/post-run.yml'
skip: true
loop_control:
loop_var: post_run_item
- name: 'Wait for {{ beat_name }} to produce output.json'
wait_for:
path: '{{ beat_output_file }}'
search_regex: '"version"'
timeout: 20
- name: "Stop {{ beat_service_name }} service"
service:
name: '{{ beat_service_name }}'
state: stopped