From 57754a43465c1777dd178b53def7d937d689cf3d Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 15 Aug 2018 23:29:10 -0500 Subject: [PATCH] Make journalbeat install detect if it should install When running on a system where there is no journal or no systemd skip the journalbeat playbooks. Change-Id: I92c804e8eb2ab2f9b86eca09fc51d19be66c7190 Signed-off-by: Kevin Carter --- elk_metrics_6x/installJournalbeat.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/elk_metrics_6x/installJournalbeat.yml b/elk_metrics_6x/installJournalbeat.yml index 836b3de4..58440329 100644 --- a/elk_metrics_6x/installJournalbeat.yml +++ b/elk_metrics_6x/installJournalbeat.yml @@ -48,6 +48,18 @@ environment: "{{ deployment_environment_variables | default({}) }}" + pre_tasks: + - name: Check for journal directory + stat: + path: /var/log/journal + register: journal_dir + + - name: exit playbook + meta: end_play + when: + - not (journal_dir.stat.exists | bool) or + ansible_service_mgr != 'systemd' + roles: - role: elastic_journalbeat - role: elastic_rollup