Correct log path and set handler

The journalbeat process was restarting every playbook run which was not
required. This change moves the restart process to a handler which will
ensure we're not restarting the services when it's not required.

Change-Id: I4c0082d04d99c71c902ae39ee5ad9efc5074889f
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-07-06 15:22:02 -05:00 committed by Kevin Carter (cloudnull)
parent e04a8b47ca
commit 553fd7d30b

View File

@ -109,14 +109,17 @@
with_items:
- "/usr/share/journalbeat"
- "/var/lib/journalbeat"
- "/var/log/journalbeat"
- "/etc/journalbeat"
- name: Install journalbeat
shell: /opt/go1.10.1/go/bin/go get -v github.com/mheese/journalbeat
args:
creates: /usr/local/bin/journalbeat
environment:
PATH: "{{ ansible_env.PATH }}:/opt/go1.10.1/go/bin"
GOPATH: /usr/local
notify:
- Enable and restart journalbeat
- name: Drop journalbeat conf file
template:
@ -125,6 +128,8 @@
with_items:
- src: templates/journalbeat.yml.j2
dest: /etc/journalbeat/journalbeat.yml
notify:
- Enable and restart journalbeat
- name: Run the systemd service role
include_role:
@ -140,7 +145,7 @@
-path.home /usr/share/journalbeat
-path.config /etc/journalbeat
-path.data /var/lib/journalbeat
-path.logs /var/log/journalbeat
-path.logs /var/log/beats
config_overrides:
Service:
EnvironmentFile: "-/etc/default/go1.10.1"
@ -149,6 +154,7 @@
Wants: network-online.target
After: network-online.target
handlers:
- name: Enable and restart journalbeat
systemd:
name: "journalbeat"