Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions filebeat/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
'RedHat': {
'config_path': '/etc/filebeat/filebeat.yml',
'config_source': 'salt://filebeat/files/filebeat.jinja',
'runlevels_install': True,
'runlevels_install': False,
},
'CentOS': {
'config_path': '/etc/filebeat/filebeat.yml',
'config_source': 'salt://filebeat/files/filebeat.jinja',
'runlevels_install': True,
'runlevels_install': False,
},
'Suse': {
'config_path': '/etc/filebeat/filebeat.yml',
Expand Down
25 changes: 7 additions & 18 deletions filebeat/service.sls
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
# filebeat 1.0.0 will not start without tty. use_vt in cmd.run, or sudo with !requiretty in sudoers (default) does not work.
# this is a hack to get around that issue.
filebeat.sshkeygen:
cmd.run:
- name: ssh-keygen -f /root/.ssh/filebeat -P ""
- unless:
- ls /root/.ssh/filebeat

filebeat.pubkeytoauth:
cmd.run:
- name: cat /root/.ssh/filebeat.pub >> /root/.ssh/authorized_keys
- unless: cat /root/.ssh/filebeat.pub | grep -f - /root/.ssh/authorized_keys
- require:
- cmd: filebeat.sshkeygen
include:
- filebeat.install

filebeat.service:
cmd.run:
- name: ssh -t -t -o NoHostAuthenticationForLocalhost=yes -i /root/.ssh/filebeat root@localhost "su -c 'service filebeat restart'"
service.running:
- name: filebeat
- enable: True
- watch:
- pkg: filebeat
- require:
- pkg: filebeat
- cmd: filebeat.sshkeygen
- cmd: filebeat.pubkeytoauth