From 12c96874372452e8a324fe3153c0f19fc75e8413 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Sat, 22 Sep 2018 19:43:14 -0400 Subject: [PATCH] Add ARM64 support This patch adds support for ARM64 beats. Unfortunately, Elastic does not publish any packages, so this points at local builds. Also, it looks like Packetbeat fails to builds so for now we just don't do anything about it on ARM. Change-Id: I1889ce51f1a4c13c311165b8b76dde7c71ecfa2d --- .../roles/elastic_auditbeat/tasks/main.yml | 15 +++++++++++- .../roles/elastic_filebeat/tasks/main.yml | 13 +++++++++++ .../roles/elastic_heartbeat/tasks/main.yml | 13 +++++++++++ .../roles/elastic_metricbeat/tasks/main.yml | 13 +++++++++++ .../roles/go_install_1.10/defaults/main.yml | 23 +++++++++++++++++++ .../go_install_1.10/tasks/go_install.yml | 15 ++++++------ .../roles/go_install_1.10/tasks/main.yml | 2 +- 7 files changed, 84 insertions(+), 10 deletions(-) create mode 100644 elk_metrics_6x/roles/go_install_1.10/defaults/main.yml diff --git a/elk_metrics_6x/roles/elastic_auditbeat/tasks/main.yml b/elk_metrics_6x/roles/elastic_auditbeat/tasks/main.yml index 51d7f4cf..3bc8858f 100644 --- a/elk_metrics_6x/roles/elastic_auditbeat/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_auditbeat/tasks/main.yml @@ -25,7 +25,7 @@ tags: - always -- name: Ensure beat is installed +- name: Ensure beat is installed (x86_64) package: name: "{{ auditbeat_distro_packages }}" state: "{{ elk_package_state | default('present') }}" @@ -34,6 +34,19 @@ until: _package_task is success retries: 3 delay: 2 + when: + - ansible_architecture == 'x86_64' + notify: + - Enable and restart auditbeat + tags: + - package_install + +- name: Ensure beat is installed (aarch64) + apt: + deb: 'https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/8709ca2640344a4ba85cba0a1d6eea69/aarch64/auditbeat-6.4.1-arm64.deb' + when: + - ansible_pkg_mgr == 'apt' + - ansible_architecture == 'aarch64' notify: - Enable and restart auditbeat tags: diff --git a/elk_metrics_6x/roles/elastic_filebeat/tasks/main.yml b/elk_metrics_6x/roles/elastic_filebeat/tasks/main.yml index e6caf1ce..a73aae7f 100644 --- a/elk_metrics_6x/roles/elastic_filebeat/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_filebeat/tasks/main.yml @@ -34,6 +34,19 @@ until: _package_task is success retries: 3 delay: 2 + when: + - ansible_architecture == 'x86_64' + notify: + - Enable and restart filebeat + tags: + - package_install + +- name: Ensure beat is installed (aarch64) + apt: + deb: 'https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/8709ca2640344a4ba85cba0a1d6eea69/aarch64/filebeat-6.4.1-arm64.deb' + when: + - ansible_pkg_mgr == 'apt' + - ansible_architecture == 'aarch64' notify: - Enable and restart filebeat tags: diff --git a/elk_metrics_6x/roles/elastic_heartbeat/tasks/main.yml b/elk_metrics_6x/roles/elastic_heartbeat/tasks/main.yml index 7dfdebc6..4903c5f0 100644 --- a/elk_metrics_6x/roles/elastic_heartbeat/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_heartbeat/tasks/main.yml @@ -34,6 +34,19 @@ until: _package_task is success retries: 3 delay: 2 + when: + - ansible_architecture == 'x86_64' + notify: + - Enable and restart heartbeat + tags: + - package_install + +- name: Ensure beat is installed (aarch64) + apt: + deb: 'https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/8709ca2640344a4ba85cba0a1d6eea69/aarch64/heartbeat-6.4.1-arm64.deb' + when: + - ansible_pkg_mgr == 'apt' + - ansible_architecture == 'aarch64' notify: - Enable and restart heartbeat tags: diff --git a/elk_metrics_6x/roles/elastic_metricbeat/tasks/main.yml b/elk_metrics_6x/roles/elastic_metricbeat/tasks/main.yml index 91c1626c..842cbb32 100644 --- a/elk_metrics_6x/roles/elastic_metricbeat/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_metricbeat/tasks/main.yml @@ -43,6 +43,19 @@ until: _package_task is success retries: 3 delay: 2 + when: + - ansible_architecture == 'x86_64' + notify: + - Enable and restart metricbeat + tags: + - package_install + +- name: Ensure beat is installed (aarch64) + apt: + deb: 'https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/8709ca2640344a4ba85cba0a1d6eea69/aarch64/metricbeat-6.4.1-arm64.deb' + when: + - ansible_pkg_mgr == 'apt' + - ansible_architecture == 'aarch64' notify: - Enable and restart metricbeat tags: diff --git a/elk_metrics_6x/roles/go_install_1.10/defaults/main.yml b/elk_metrics_6x/roles/go_install_1.10/defaults/main.yml new file mode 100644 index 00000000..38fc38d5 --- /dev/null +++ b/elk_metrics_6x/roles/go_install_1.10/defaults/main.yml @@ -0,0 +1,23 @@ +--- +# Copyright 2018, Logan Vig +# +# 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. + +# Versions and SHAs published at https://golang.org/dl/ +go_download_version: 1.10.1 +go_download_url: "https://dl.google.com/go/{{ go_download_filename }}" +go_download_arch: "{{ go_arch_translation[ansible_architecture] | default(ansible_architecture) }}" +go_download_filename: "go{{ go_download_version }}.linux-{{ go_download_arch }}.tar.gz" +go_arch_translation: + x86_64: amd64 + aarch64: arm64 diff --git a/elk_metrics_6x/roles/go_install_1.10/tasks/go_install.yml b/elk_metrics_6x/roles/go_install_1.10/tasks/go_install.yml index 904bb619..0110a8c6 100644 --- a/elk_metrics_6x/roles/go_install_1.10/tasks/go_install.yml +++ b/elk_metrics_6x/roles/go_install_1.10/tasks/go_install.yml @@ -15,9 +15,8 @@ - name: GET go get_url: - url: "https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz" - dest: "/opt/go1.10.1.linux-amd64.tar.gz" - checksum: "sha256:72d820dec546752e5a8303b33b009079c15c2390ce76d67cf514991646c6127b" + url: "{{ go_download_url }}" + dest: "/opt/{{ go_download_filename }}" register: _get_task until: _get_task is success retries: 3 @@ -27,19 +26,19 @@ - name: Create go directory file: - path: "/opt/go1.10.1" + path: "/opt/go{{ go_download_version }}" state: directory - name: Unarchive go unarchive: - src: "/opt/go1.10.1.linux-amd64.tar.gz" - dest: "/opt/go1.10.1" + src: "/opt/{{ go_download_filename }}" + dest: "/opt/go{{ go_download_version }}" remote_src: yes - name: Create go defaults file copy: content: | - GOROOT=/opt/go1.10.1/go + GOROOT=/opt/go{{ go_download_version }}/go GOPATH=/usr/local PATH=${PATH}:${GOROOT}/bin - dest: /etc/default/go1.10.1 + dest: "/etc/default/go{{ go_download_version }}" diff --git a/elk_metrics_6x/roles/go_install_1.10/tasks/main.yml b/elk_metrics_6x/roles/go_install_1.10/tasks/main.yml index c7940ca1..6a2a2553 100644 --- a/elk_metrics_6x/roles/go_install_1.10/tasks/main.yml +++ b/elk_metrics_6x/roles/go_install_1.10/tasks/main.yml @@ -15,7 +15,7 @@ - name: Check for go stat: - path: /opt/go1.10.1/go/bin/go + path: "/opt/go{{ go_download_version }}/go/bin/go" register: go_path - include_tasks: go_install.yml