2018-04-28 23:50:36 -05:00
|
|
|
---
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2018-07-05 19:28:02 +00:00
|
|
|
- name: Detect journalbeat host deployment group(s)
|
|
|
|
hosts: all
|
|
|
|
gather_facts: false
|
|
|
|
connection: local
|
|
|
|
tasks:
|
|
|
|
- name: Add hosts to dynamic inventory group
|
|
|
|
group_by:
|
|
|
|
key: journalbeat_deployment_containers
|
|
|
|
parents: all_journalbeat_deployments
|
|
|
|
when:
|
|
|
|
- openstack_release is defined and
|
|
|
|
openstack_release is version('18.0.0', 'lt')
|
|
|
|
- physical_host is defined and
|
|
|
|
physical_host != inventory_hostname
|
|
|
|
|
|
|
|
- name: Add hosts to dynamic inventory group
|
|
|
|
group_by:
|
|
|
|
key: journalbeat_deployment_hosts
|
|
|
|
parents: all_journalbeat_deployments
|
|
|
|
when:
|
2018-08-08 01:11:51 -05:00
|
|
|
- physical_host is undefined or
|
2018-07-05 19:28:02 +00:00
|
|
|
physical_host == inventory_hostname
|
|
|
|
|
|
|
|
tags:
|
|
|
|
- always
|
|
|
|
|
2018-04-28 23:50:36 -05:00
|
|
|
- name: Install Journalbeat
|
2018-07-05 19:28:02 +00:00
|
|
|
hosts: all_journalbeat_deployments
|
2018-04-28 23:50:36 -05:00
|
|
|
become: true
|
|
|
|
vars:
|
|
|
|
haproxy_ssl: false
|
|
|
|
|
|
|
|
vars_files:
|
|
|
|
- vars/variables.yml
|
|
|
|
|
2018-05-16 11:18:33 +01:00
|
|
|
environment: "{{ deployment_environment_variables | default({}) }}"
|
|
|
|
|
2018-08-15 23:29:10 -05:00
|
|
|
pre_tasks:
|
|
|
|
- name: Check for journal directory
|
|
|
|
stat:
|
|
|
|
path: /var/log/journal
|
|
|
|
register: journal_dir
|
2018-09-25 12:32:10 +01:00
|
|
|
tags:
|
|
|
|
- always
|
2018-08-15 23:29:10 -05:00
|
|
|
|
2018-08-08 01:11:51 -05:00
|
|
|
roles:
|
|
|
|
- role: elastic_journalbeat
|
2018-09-25 12:32:10 +01:00
|
|
|
when:
|
|
|
|
- journal_dir.stat.exists | bool
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
|
2018-08-08 01:11:51 -05:00
|
|
|
- role: elastic_rollup
|
2018-09-25 12:32:10 +01:00
|
|
|
when:
|
|
|
|
- journal_dir.stat.exists | bool
|
|
|
|
- ansible_service_mgr == 'systemd'
|
2018-08-08 01:11:51 -05:00
|
|
|
index_name: journalbeat
|
2018-04-28 23:50:36 -05:00
|
|
|
|
2018-06-15 16:45:49 -05:00
|
|
|
tags:
|
|
|
|
- beat-install
|