|
1 | 1 | --- |
2 | 2 |
|
3 | | -- name: Check if Logstash pipeline already exists |
| 3 | +- name: Check if Logstash pipeline {{ pipelinename.name }} already exists |
4 | 4 | ansible.builtin.stat: |
5 | 5 | path: "/etc/logstash/conf.d/{{ pipelinename.name }}" |
6 | 6 | register: "logstash_pipeline_stat" |
7 | 7 |
|
8 | | -- name: Check who managed pipeline in last run # noqa: risky-shell-pipe |
| 8 | +- name: Check who managed pipeline {{ pipelinename.name }} in last run # noqa: risky-shell-pipe |
9 | 9 | ansible.builtin.shell: > |
10 | 10 | if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi; |
11 | 11 | grep -e '^# source:{{ pipelinename.name }}' /etc/logstash/pipelines.yml | |
|
16 | 16 | - logstash_pipeline_stat.stat.exists | bool |
17 | 17 | - logstash_pipeline_stat.stat.isdir | bool |
18 | 18 |
|
19 | | -- name: Delete directory if changing manager |
| 19 | +- name: Delete directory if changing manager of pipeline {{ pipelinename.name }} |
20 | 20 | ansible.builtin.file: |
21 | 21 | path: "/etc/logstash/conf.d/{{ pipelinename.name }}" |
22 | 22 | state: absent |
|
25 | 25 | - logstash_pipeline_manager.stdout == "local" |
26 | 26 | - pipelinename.source is defined |
27 | 27 |
|
28 | | -- name: Create Logstash pipeline directories |
| 28 | +- name: Create Logstash pipeline {{ pipelinename.name }} directory |
29 | 29 | ansible.builtin.file: |
30 | 30 | path: "/etc/logstash/conf.d/{{ pipelinename.name }}" |
31 | 31 | state: directory |
32 | 32 | owner: root |
33 | 33 | group: root |
34 | 34 | mode: 0755 |
35 | 35 |
|
36 | | -- name: Check out pipeline configuration |
| 36 | +- name: Check out pipeline configuration for {{ pipelinename.name }} |
37 | 37 | ansible.builtin.git: |
38 | 38 | repo: "{{ pipelinename.source }}" |
39 | 39 | dest: "/etc/logstash/conf.d/{{ pipelinename.name }}" |
|
42 | 42 | notify: |
43 | 43 | - Restart Logstash noauto |
44 | 44 |
|
45 | | -- name: Create simple input |
| 45 | +- name: Create simple input for {{ pipelinename.name }} |
46 | 46 | ansible.builtin.template: |
47 | 47 | src: simple-input.conf.j2 |
48 | 48 | dest: "/etc/logstash/conf.d/{{ pipelinename.name }}\ |
|
54 | 54 | notify: |
55 | 55 | - Restart Logstash noauto |
56 | 56 |
|
57 | | -- name: Create simple output |
| 57 | +- name: Create simple output for {{ pipelinename.name }} |
58 | 58 | ansible.builtin.template: |
59 | 59 | src: simple-output.conf.j2 |
60 | 60 | dest: "/etc/logstash/conf.d/{{ pipelinename.name }}\ |
|
0 commit comments