Add Redhat to the ELK deployment capabilities

Change-Id: Id34e046a546f8d0878843596f53e400165e37c6e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-08-13 10:57:20 -05:00
parent 62039aa3cf
commit e4c84aa28d
No known key found for this signature in database
GPG Key ID: 9443251A787B9FB3
18 changed files with 347 additions and 15 deletions

View File

@ -0,0 +1,17 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
apm_server_distro_packages:
- apm-server

View File

@ -0,0 +1,18 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
auditbeat_distro_packages:
- audispd-plugins
- auditbeat

View File

@ -0,0 +1,17 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
curator_distro_packages:
- python-virtualenv

View File

@ -105,7 +105,15 @@
when:
- physical_host == inventory_hostname
- name: elasticsearch datapath bind mount
- name: Container block
block:
- name: Ensure service directories data-path exists
file:
path: "/openstack/{{ inventory_hostname }}/{{ service_name }}"
state: "directory"
delegate_to: "{{ physical_host }}"
- name: elasticsearch datapath bind mount
lxc_container:
name: "{{ inventory_hostname }}"
container_command: |
@ -114,8 +122,9 @@
- "lxc.mount.entry=/openstack/{{ inventory_hostname }}/{{ service_name }} var/lib/{{ service_name }} none bind 0 0"
delegate_to: "{{ physical_host }}"
when:
- physical_host != inventory_hostname
- container_tech | default('lxc') == 'lxc'
when:
- physical_host != inventory_hostname
- name: Ensure Java is installed
package:
@ -149,6 +158,17 @@
createhome: "yes"
home: "/var/lib/{{ service_name }}"
rescue:
- name: Check for system user
debug:
msg: >-
The general user creation task failed. This typically means that the
user already exists and something in the user configuration provided
is changing the system user in way that is simply not possible at this
time. The playbooks will now simply ensure the user exists and before
carrying on to the next task. While it's not required, it may be
benificial to schedule a maintenance where the elastic services are
stopped.
- name: Ensure the system user exists
user:
name: "{{ service_owner }}"

View File

@ -0,0 +1,17 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
elastic_distro_packages:
- java-1.8.0-openjdk

View File

@ -0,0 +1,17 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
filebeat_distro_packages:
- filebeat

View File

@ -0,0 +1,17 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
heartbeat_distro_packages:
- heartbeat-elastic

View File

@ -0,0 +1,19 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
journalbeat_distro_packages:
- gcc
- git
- systemd-devel

View File

@ -0,0 +1,20 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
kibana_nginx_vhost_path: /etc/nginx/conf.d/
kibana_distro_packages:
- kibana
- nginx
- python-passlib

View File

@ -0,0 +1,18 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
logstash_distro_packages:
- logrotate
- logstash

View File

@ -0,0 +1,18 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
metricbeat_nginx_vhost_path: /etc/nginx/conf.d/
metricbeat_distro_packages:
- metricbeat

View File

@ -0,0 +1,18 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
packetbeat_distro_packages:
- tcpdump
- packetbeat

View File

@ -0,0 +1,58 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
- name: Add Elastic search public GPG key
rpm_key:
state: "{{ elastic_repo.state }}"
key: "{{ elastic_repo.key_url }}"
register: _zypp_task
until: _zypp_task is success
retries: 3
delay: 2
tags:
- package_install
# Force refresh of a repository
- name: Add elk repo to yum sources list
yum_repository:
name: "elastic"
file: "elastic"
description: "Elastic repositories, you know, for ELK."
baseurl: "{{ elastic_repo.repo }}"
state: "{{ elastic_repo.state }}"
enabled: yes
register: _yum_task
until: _yum_task is success
retries: 3
delay: 2
tags:
- package_install
# Force refresh of a repository
- name: Add nginx repo to yum sources list
yum_repository:
name: "nginx"
file: "nginx"
description: "NGINX repo"
baseurl: "{{ elastic_nginx_repo.repo }}"
state: "{{ elastic_nginx_repo.state }}"
enabled: yes
gpgcheck: no
register: _yum_task
until: _yum_task is success
retries: 3
delay: 2
tags:
- package_install

View File

@ -0,0 +1,24 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
# elk apt repo
elastic_repo:
repo: 'https://artifacts.elastic.co/packages/6.x/yum'
state: "{{ ((elk_package_state | default('present')) == 'absent') | ternary('absent', 'present') }}"
key_url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch"
elastic_nginx_repo:
repo: 'http://nginx.org/packages/centos/$releasever/$basearch/'
state: "{{ ((elk_package_state | default('present')) == 'absent') | ternary('absent', 'present') }}"

View File

@ -0,0 +1,18 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
elasticsearch_distro_packages:
- logrotate
- elasticsearch

View File

@ -1,4 +1,9 @@
---
# Option to define third memory
q_mem: "{{ (ansible_memtotal_mb | int) // 3 }}"
# Option to define half memory
h_mem: "{{ (ansible_memtotal_mb | int) // 2 }}"
apm_port: 8200
elastic_port: 9200

View File

@ -25,17 +25,26 @@
osa_test_repo: "openstack/openstack-ansible-ops"
test_clustered_elk: false
# - job:
# name: "openstack-ansible-ops:elk_metrics_6x-centos-7"
# parent: "openstack-ansible-ops:elk_metrics_6x-ubuntu-xenial"
# nodeset: centos-7
# voting: false
- job:
name: "openstack-ansible-ops:elk_metrics_6x-centos-7"
parent: "openstack-ansible-ops:elk_metrics_6x-ubuntu-xenial"
nodeset: centos-7
voting: true
- job:
name: "openstack-ansible-ops:elk_metrics_6x-centos-7-clustered"
parent: "openstack-ansible-ops:elk_metrics_6x-ubuntu-xenial"
nodeset: centos-7
voting: false
vars:
osa_test_repo: "openstack/openstack-ansible-ops"
test_clustered_elk: true
- job:
name: "openstack-ansible-ops:elk_metrics_6x-opensuse-423"
parent: "openstack-ansible-ops:elk_metrics_6x-ubuntu-xenial"
nodeset: opensuse-423
voting: false
voting: true
- job:
name: "openstack-ansible-ops:elk_metrics_6x-opensuse-423-clustered"

View File

@ -17,6 +17,8 @@
- openstack-ansible-role-jobs
check:
jobs:
- "openstack-ansible-ops:elk_metrics_6x-centos-7"
- "openstack-ansible-ops:elk_metrics_6x-centos-7-clustered"
- "openstack-ansible-ops:elk_metrics_6x-opensuse-423"
- "openstack-ansible-ops:elk_metrics_6x-opensuse-423-clustered"
- "openstack-ansible-ops:elk_metrics_6x-ubuntu-trusty"