From 553fd7d30b67ad8d42ae3fc9f2689dc704081acd Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Fri, 6 Jul 2018 15:22:02 -0500 Subject: [PATCH] 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 --- elk_metrics_6x/installJournalbeat.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/elk_metrics_6x/installJournalbeat.yml b/elk_metrics_6x/installJournalbeat.yml index 1811596f..4e3b10be 100644 --- a/elk_metrics_6x/installJournalbeat.yml +++ b/elk_metrics_6x/installJournalbeat.yml @@ -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"