From bf6a8d85e7da26f2a96b2527e6457370b2af1b7e Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Sun, 12 Aug 2018 23:47:23 -0500 Subject: [PATCH] Add SUSE support This change adds SUSE 42.3 support to the elastic telemetry solutions. Change-Id: Ibe93ea0d1ead9e7fe6da16d89989cfe5ade0f43e Signed-off-by: Kevin Carter --- .../roles/elastic_apm_server/tasks/main.yml | 2 +- .../roles/elastic_apm_server/vars/suse.yml | 17 ++++++++ .../roles/elastic_auditbeat/tasks/main.yml | 2 +- .../roles/elastic_auditbeat/vars/suse.yml | 18 +++++++++ .../roles/elastic_curator/tasks/main.yml | 2 +- .../roles/elastic_curator/vars/suse.yml | 17 ++++++++ .../roles/elastic_dependencies/tasks/main.yml | 16 +++++++- .../roles/elastic_dependencies/vars/suse.yml | 17 ++++++++ .../roles/elastic_filebeat/tasks/main.yml | 2 +- .../roles/elastic_filebeat/vars/suse.yml | 17 ++++++++ .../roles/elastic_heartbeat/tasks/main.yml | 2 +- .../roles/elastic_heartbeat/vars/suse.yml | 17 ++++++++ .../roles/elastic_journalbeat/tasks/main.yml | 2 +- .../roles/elastic_journalbeat/vars/suse.yml | 19 +++++++++ .../roles/elastic_kibana/tasks/main.yml | 4 +- .../roles/elastic_kibana/vars/suse.yml | 21 ++++++++++ .../roles/elastic_kibana/vars/ubuntu.yml | 1 + .../roles/elastic_logstash/tasks/main.yml | 2 +- .../roles/elastic_logstash/vars/suse.yml | 18 +++++++++ .../roles/elastic_metricbeat/tasks/main.yml | 11 +----- .../roles/elastic_metricbeat/vars/suse.yml | 18 +++++++++ .../roles/elastic_metricbeat/vars/ubuntu.yml | 1 + .../roles/elastic_packetbeat/tasks/main.yml | 2 +- .../roles/elastic_packetbeat/vars/suse.yml | 18 +++++++++ .../elastic_repositories/defaults/main.yml | 3 ++ .../tasks/elastic_zypper_repos.yml | 39 +++++++++++++++++++ .../roles/elastic_repositories/tasks/main.yml | 2 +- .../roles/elastic_repositories/vars/suse.yml | 20 ++++++++++ .../roles/elastic_retention/tasks/main.yml | 2 +- .../roles/elasticsearch/tasks/main.yml | 2 +- .../roles/elasticsearch/vars/suse.yml | 18 +++++++++ elk_metrics_6x/setupKibanaDashboard.yml | 19 ++++++--- zuul.d/jobs.yaml | 21 +++++++--- zuul.d/project.yaml | 2 + 34 files changed, 339 insertions(+), 35 deletions(-) create mode 100644 elk_metrics_6x/roles/elastic_apm_server/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_auditbeat/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_curator/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_dependencies/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_filebeat/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_heartbeat/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_journalbeat/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_kibana/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_logstash/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_metricbeat/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_packetbeat/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elastic_repositories/tasks/elastic_zypper_repos.yml create mode 100644 elk_metrics_6x/roles/elastic_repositories/vars/suse.yml create mode 100644 elk_metrics_6x/roles/elasticsearch/vars/suse.yml diff --git a/elk_metrics_6x/roles/elastic_apm_server/tasks/main.yml b/elk_metrics_6x/roles/elastic_apm_server/tasks/main.yml index cff5393e..4492505a 100644 --- a/elk_metrics_6x/roles/elastic_apm_server/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_apm_server/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_apm_server/vars/suse.yml b/elk_metrics_6x/roles/elastic_apm_server/vars/suse.yml new file mode 100644 index 00000000..3fac8c52 --- /dev/null +++ b/elk_metrics_6x/roles/elastic_apm_server/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_auditbeat/tasks/main.yml b/elk_metrics_6x/roles/elastic_auditbeat/tasks/main.yml index a493ec42..e131e1e9 100644 --- a/elk_metrics_6x/roles/elastic_auditbeat/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_auditbeat/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_auditbeat/vars/suse.yml b/elk_metrics_6x/roles/elastic_auditbeat/vars/suse.yml new file mode 100644 index 00000000..4144a896 --- /dev/null +++ b/elk_metrics_6x/roles/elastic_auditbeat/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_curator/tasks/main.yml b/elk_metrics_6x/roles/elastic_curator/tasks/main.yml index 1205d33d..24f94d20 100644 --- a/elk_metrics_6x/roles/elastic_curator/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_curator/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_curator/vars/suse.yml b/elk_metrics_6x/roles/elastic_curator/vars/suse.yml new file mode 100644 index 00000000..a3eb703e --- /dev/null +++ b/elk_metrics_6x/roles/elastic_curator/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_dependencies/tasks/main.yml b/elk_metrics_6x/roles/elastic_dependencies/tasks/main.yml index e549bf57..a49b2a96 100644 --- a/elk_metrics_6x/roles/elastic_dependencies/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_dependencies/tasks/main.yml @@ -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 }}" diff --git a/elk_metrics_6x/roles/elastic_dependencies/vars/suse.yml b/elk_metrics_6x/roles/elastic_dependencies/vars/suse.yml new file mode 100644 index 00000000..554bfe46 --- /dev/null +++ b/elk_metrics_6x/roles/elastic_dependencies/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_filebeat/tasks/main.yml b/elk_metrics_6x/roles/elastic_filebeat/tasks/main.yml index e0eea3ac..001df996 100644 --- a/elk_metrics_6x/roles/elastic_filebeat/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_filebeat/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_filebeat/vars/suse.yml b/elk_metrics_6x/roles/elastic_filebeat/vars/suse.yml new file mode 100644 index 00000000..2f055205 --- /dev/null +++ b/elk_metrics_6x/roles/elastic_filebeat/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_heartbeat/tasks/main.yml b/elk_metrics_6x/roles/elastic_heartbeat/tasks/main.yml index 7483ad5f..bab6835a 100644 --- a/elk_metrics_6x/roles/elastic_heartbeat/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_heartbeat/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_heartbeat/vars/suse.yml b/elk_metrics_6x/roles/elastic_heartbeat/vars/suse.yml new file mode 100644 index 00000000..4a32d6b7 --- /dev/null +++ b/elk_metrics_6x/roles/elastic_heartbeat/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_journalbeat/tasks/main.yml b/elk_metrics_6x/roles/elastic_journalbeat/tasks/main.yml index 68fbd8f3..c5a0e2dd 100644 --- a/elk_metrics_6x/roles/elastic_journalbeat/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_journalbeat/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_journalbeat/vars/suse.yml b/elk_metrics_6x/roles/elastic_journalbeat/vars/suse.yml new file mode 100644 index 00000000..77c33669 --- /dev/null +++ b/elk_metrics_6x/roles/elastic_journalbeat/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_kibana/tasks/main.yml b/elk_metrics_6x/roles/elastic_kibana/tasks/main.yml index 7bba6c9a..c94a77d8 100644 --- a/elk_metrics_6x/roles/elastic_kibana/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_kibana/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_kibana/vars/suse.yml b/elk_metrics_6x/roles/elastic_kibana/vars/suse.yml new file mode 100644 index 00000000..761a02bc --- /dev/null +++ b/elk_metrics_6x/roles/elastic_kibana/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_kibana/vars/ubuntu.yml b/elk_metrics_6x/roles/elastic_kibana/vars/ubuntu.yml index 780eb881..193b6e8a 100644 --- a/elk_metrics_6x/roles/elastic_kibana/vars/ubuntu.yml +++ b/elk_metrics_6x/roles/elastic_kibana/vars/ubuntu.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_logstash/tasks/main.yml b/elk_metrics_6x/roles/elastic_logstash/tasks/main.yml index 2f20b343..783b025d 100644 --- a/elk_metrics_6x/roles/elastic_logstash/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_logstash/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_logstash/vars/suse.yml b/elk_metrics_6x/roles/elastic_logstash/vars/suse.yml new file mode 100644 index 00000000..716310e6 --- /dev/null +++ b/elk_metrics_6x/roles/elastic_logstash/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_metricbeat/tasks/main.yml b/elk_metrics_6x/roles/elastic_metricbeat/tasks/main.yml index ccba51af..387a4ce5 100644 --- a/elk_metrics_6x/roles/elastic_metricbeat/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_metricbeat/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_metricbeat/vars/suse.yml b/elk_metrics_6x/roles/elastic_metricbeat/vars/suse.yml new file mode 100644 index 00000000..8450bcfb --- /dev/null +++ b/elk_metrics_6x/roles/elastic_metricbeat/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_metricbeat/vars/ubuntu.yml b/elk_metrics_6x/roles/elastic_metricbeat/vars/ubuntu.yml index 2eecca08..98f323b5 100644 --- a/elk_metrics_6x/roles/elastic_metricbeat/vars/ubuntu.yml +++ b/elk_metrics_6x/roles/elastic_metricbeat/vars/ubuntu.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_packetbeat/tasks/main.yml b/elk_metrics_6x/roles/elastic_packetbeat/tasks/main.yml index 51a2dfe7..7cb058e9 100644 --- a/elk_metrics_6x/roles/elastic_packetbeat/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_packetbeat/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_packetbeat/vars/suse.yml b/elk_metrics_6x/roles/elastic_packetbeat/vars/suse.yml new file mode 100644 index 00000000..e949478a --- /dev/null +++ b/elk_metrics_6x/roles/elastic_packetbeat/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_repositories/defaults/main.yml b/elk_metrics_6x/roles/elastic_repositories/defaults/main.yml index c4e99cd8..8448bf56 100644 --- a/elk_metrics_6x/roles/elastic_repositories/defaults/main.yml +++ b/elk_metrics_6x/roles/elastic_repositories/defaults/main.yml @@ -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: [] diff --git a/elk_metrics_6x/roles/elastic_repositories/tasks/elastic_zypper_repos.yml b/elk_metrics_6x/roles/elastic_repositories/tasks/elastic_zypper_repos.yml new file mode 100644 index 00000000..c2c85ff1 --- /dev/null +++ b/elk_metrics_6x/roles/elastic_repositories/tasks/elastic_zypper_repos.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_repositories/tasks/main.yml b/elk_metrics_6x/roles/elastic_repositories/tasks/main.yml index 0708ca46..b5eee5d5 100644 --- a/elk_metrics_6x/roles/elastic_repositories/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_repositories/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elastic_repositories/vars/suse.yml b/elk_metrics_6x/roles/elastic_repositories/vars/suse.yml new file mode 100644 index 00000000..9280dca7 --- /dev/null +++ b/elk_metrics_6x/roles/elastic_repositories/vars/suse.yml @@ -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" diff --git a/elk_metrics_6x/roles/elastic_retention/tasks/main.yml b/elk_metrics_6x/roles/elastic_retention/tasks/main.yml index 277a6f31..6c79ac41 100644 --- a/elk_metrics_6x/roles/elastic_retention/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_retention/tasks/main.yml @@ -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 }}" diff --git a/elk_metrics_6x/roles/elasticsearch/tasks/main.yml b/elk_metrics_6x/roles/elasticsearch/tasks/main.yml index 9e9d3200..32dcb04c 100644 --- a/elk_metrics_6x/roles/elasticsearch/tasks/main.yml +++ b/elk_metrics_6x/roles/elasticsearch/tasks/main.yml @@ -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 diff --git a/elk_metrics_6x/roles/elasticsearch/vars/suse.yml b/elk_metrics_6x/roles/elasticsearch/vars/suse.yml new file mode 100644 index 00000000..a5948d12 --- /dev/null +++ b/elk_metrics_6x/roles/elasticsearch/vars/suse.yml @@ -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 diff --git a/elk_metrics_6x/setupKibanaDashboard.yml b/elk_metrics_6x/setupKibanaDashboard.yml index bc9fabeb..69aae0a3 100644 --- a/elk_metrics_6x/setupKibanaDashboard.yml +++ b/elk_metrics_6x/setupKibanaDashboard.yml @@ -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 diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index f548474a..7d3d4ec4 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -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" diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 0b816d0f..0445cf71 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -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"