Add SUSE support

This change adds SUSE 42.3 support to the elastic telemetry solutions.

Change-Id: Ibe93ea0d1ead9e7fe6da16d89989cfe5ade0f43e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-08-12 23:47:23 -05:00
parent 8db0238749
commit bf6a8d85e7
No known key found for this signature in database
GPG Key ID: 9443251A787B9FB3
34 changed files with 339 additions and 35 deletions

View File

@ -29,7 +29,7 @@
package:
name: "{{ apm_server_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: true
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3

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

@ -29,7 +29,7 @@
package:
name: "{{ auditbeat_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: true
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3

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:
- audit-audispd-plugins
- auditbeat

View File

@ -34,7 +34,7 @@
package:
name: "{{ curator_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: true
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
tags:
- package_install

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

@ -121,8 +121,8 @@
package:
name: "{{ elastic_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
install_recommends: yes
update_cache: yes
install_recommends: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3
@ -170,3 +170,15 @@
dest: "/etc/{{ service_name }}/jvm.options"
- src: "templates/logrotate.j2"
dest: "/etc/logrotate.d/{{ service_name }}"
- name: Ensure host can resolve itself
lineinfile:
path: /etc/hosts
regexp: '^{{ item }}'
line: '{{ item }} {{ ansible_hostname }} {{ ansible_fqdn }}'
owner: root
group: root
mode: 0644
with_items:
- "127.0.2.1"
- "{{ ansible_host }}"

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

@ -29,7 +29,7 @@
package:
name: "{{ filebeat_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: true
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3

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

@ -29,7 +29,7 @@
package:
name: "{{ heartbeat_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: true
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3

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

@ -40,7 +40,7 @@
package:
name: "{{ journalbeat_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: true
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3

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

@ -29,7 +29,7 @@
package:
name: "{{ kibana_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: yes
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3
@ -52,7 +52,7 @@
- name: Drop Nginx default conf file
template:
src: "nginx_default.j2"
dest: "/etc/nginx/sites-available/default"
dest: "{{ kibana_nginx_vhost_path }}/default"
notify:
- Enable and restart services

View File

@ -0,0 +1,21 @@
---
# 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/vhosts.d
kibana_distro_packages:
- apache2-utils
- kibana
- nginx
- python-passlib

View File

@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
kibana_nginx_vhost_path: /etc/nginx/sites-available
kibana_distro_packages:
- apache2-utils
- kibana

View File

@ -29,7 +29,7 @@
package:
name: "{{ logstash_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: yes
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3

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

@ -29,7 +29,7 @@
package:
name: "{{ metricbeat_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: true
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3
@ -180,14 +180,7 @@
- name: Drop nginx stats site config
template:
src: nginx-status.conf.j2
dest: /etc/nginx/sites-available/nginx-status.conf
when: nginx_enabled
- name: Enable nginx stats site
file:
src: /etc/nginx/sites-available/nginx-status.conf
dest: /etc/nginx/sites-enabled/nginx-status.conf
state: link
dest: "{{ metricbeat_nginx_vhost_path }}/nginx-status.conf"
register: nginx_status
when: nginx_enabled

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/vhosts.d
metricbeat_distro_packages:
- metricbeat

View File

@ -13,5 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
metricbeat_nginx_vhost_path: /etc/nginx/sites-enabled
metricbeat_distro_packages:
- metricbeat

View File

@ -29,7 +29,7 @@
package:
name: "{{ packetbeat_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: true
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3

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

@ -15,3 +15,6 @@
# List of PPA repositories used on ubuntu based systems
elastic_repo_ppas: []
# List of packages to install
elastic_repo_distro_packages: []

View File

@ -0,0 +1,39 @@
---
# 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 zypper sources list
zypper_repository:
name: "elastic"
repo: "{{ elastic_repo.repo }}"
state: "{{ elastic_repo.state }}"
runrefresh: yes
register: _zypp_task
until: _zypp_task is success
retries: 3
delay: 2
tags:
- package_install

View File

@ -29,7 +29,7 @@
package:
name: "{{ elastic_repo_distro_packages }}"
state: present
update_cache: yes
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _apt_task
until: _apt_task is success
retries: 3

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.
# 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"

View File

@ -36,4 +36,4 @@
- name: Set retention keys fact
set_fact:
elastic_beat_retention_policy_keys: "{{ elastic_beat_retention_policy_hosts.keys() }}"
elastic_beat_retention_policy_keys: "{{ elastic_beat_retention_policy_hosts.keys() | list }}"

View File

@ -34,7 +34,7 @@
package:
name: "{{ elasticsearch_distro_packages }}"
state: "{{ elk_package_state | default('present') }}"
update_cache: yes
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _package_task
until: _package_task is success
retries: 3

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

@ -19,17 +19,26 @@
environment: "{{ deployment_environment_variables | default({}) }}"
vars:
disto_packages:
zypper:
- nodejs6
apt:
- nodejs
tasks:
- name: Add nodejs 6.x source
shell: "curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -"
when:
- ansible_pkg_mgr == 'apt'
- name: Install nodejs
apt:
name: nodejs
package:
name: "{{ disto_packages[ansible_pkg_mgr] }}"
state: "present"
update_cache: yes
register: _apt_task
until: _apt_task is success
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
register: _pkg_task
until: _pkg_task is success
retries: 3
delay: 2

View File

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

View File

@ -17,6 +17,8 @@
- openstack-ansible-role-jobs
check:
jobs:
- "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"
- "openstack-ansible-ops:elk_metrics_6x-ubuntu-xenial"
- "openstack-ansible-ops:elk_metrics_6x-ubuntu-bionic"