Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Javier Franco
/
elk_installation
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
6b4f1ff7
authored
2022-08-12 13:16:12 -0400
by
Gustavo Calcaterra
Committed by
Javier Franco
2022-08-12 13:16:12 -0400
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add handlers to restart beats
1 parent
189a9c13
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
6 deletions
roles/beat/handlers/main.yml
roles/beat/tasks/main.yml
roles/beat/handlers/main.yml
View file @
6b4f1ff
---
# handlers file for beat
-
name
:
Restart beat service
service
:
name
:
"
{{
beat_name
}}"
state
:
restarted
listen
:
"
restart
all
beats
services"
# - name: Restart filebeat
# service:
# name: filebeat
# state: restarted
# listen: "restart all beats services"
#
# - name: Restart metribeat
# service:
# name: metricbeat
# state: restarted
# listen: "restart all beats services"
#
# - name: Restart packetbeat
# service:
# name: packetbeat
# state: restarted
# listen: "restart all beats services"
...
...
roles/beat/tasks/main.yml
View file @
6b4f1ff
...
...
@@ -11,6 +11,7 @@
template
:
src
:
templates/{{ beat_name }}.yml.j2
dest
:
/etc/{{ beat_name }}/{{ beat_name }}.yml
notify
:
"
Restart
beat
service"
-
name
:
Test {{ beat_name }} connection
shell
:
'
{{
beat_name
}}
test
output'
...
...
@@ -43,15 +44,20 @@
-
"
verify_system_result.rc
!=
0"
register
:
result
changed_when
:
"
'Module
system
is
already
enabled'
not
in
result.stdout"
notify
:
"
Restart
beat
service"
-
name
:
Run {{ beat_name }} setup and dashboard config on kibana
shell
:
'
{{
beat_name
}}
setup'
register
:
result
changed_when
:
"
result.rc
!
=
0"
changed_when
:
"
result.rc
=
=
0"
ignore_errors
:
True
notify
:
"
Restart
beat
service"
-
name
:
Start {{ beat_name }} service
service
:
name
:
'
{{
beat_name
}}'
state
:
started
enabled
:
yes
-
name
:
Flush handlers
meta
:
flush_handlers
#- name: Start {{ beat_name }} service
# service:
# name: '{{ beat_name }}'
# state: started
# enabled: yes
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment