Skip to content
Snippets Groups Projects
Commit 32b23874 authored by Alexander Käb's avatar Alexander Käb
Browse files

feat(filebeat): Use filebeat RPM instead of repository

Instead of relying on the repository for filebeat to be reachable via
IPv6 download the RPM file on the ansible host and copy it to the
nodes filebeat should be installed on.

Implements #3
parent 217d6e6e
No related branches found
No related tags found
No related merge requests found
.vscode
\ No newline at end of file
...@@ -7,8 +7,12 @@ sidecar_checksum: https://github.com/Graylog2/collector-sidecar/releases/downloa ...@@ -7,8 +7,12 @@ sidecar_checksum: https://github.com/Graylog2/collector-sidecar/releases/downloa
install_filebeat: true install_filebeat: true
filebeat_repo_urls: filebeat_repo_urls:
"RedHat": "https://artifacts.elastic.co/packages/oss-8.x/yum" "RedHat": "https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.8.0-x86_64.rpm"
"Debian": "https://artifacts.elastic.co/packages/oss-8.x/apt" "Debian": "https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.8.0-amd64.deb"
filebeat_checksums:
"RedHat": "https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.8.0-x86_64.rpm.sha512"
"Debian": "https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.8.0-amd64.deb.sha512"
# --- OTHER --- # --- OTHER ---
use_central_ca_host: false use_central_ca_host: false
......
...@@ -3,35 +3,50 @@ ...@@ -3,35 +3,50 @@
become: true become: true
when: ansible_os_family == 'Debian' when: ansible_os_family == 'Debian'
block: block:
- name: Ensure Apt Can Use Https - name: install filebeat (Debian | Ubuntu)
ansible.builtin.apt: when: ansible_os_family == 'Debian'
name: apt-transport-https become: true
state: present block:
- name: Download repository file (Debian | Ubuntu)
ansible.builtin.get_url:
url: "{{ filebeat_repo_urls['Debian'] }}"
checksum: "sha256:{{ filebeat_checksums['Debian'] }}"
dest: /tmp/graylog-filebeat.deb
mode: 0644
delegate_to: localhost
run_once: true
- name: Ensure ES Signing Key Is Present - name: Copy DEB to nodes (Debian | Ubuntu)
ansible.builtin.apt_key: ansible.builtin.copy:
url: 'https://artifacts.elastic.co/GPG-KEY-elasticsearch' src: /tmp/graylog-filebeat.deb
id: '46095ACC8548582C1A2699A9D27D666CD88E42B4' dest: /tmp/graylog-filebeat.deb
state: present^ mode: 0644
- name: Ensure ES Repo Is Enabled - name: Add package using dpkg (Debian | Ubuntu)
ansible.builtin.apt_repository: ansible.builtin.command:
repo: "deb {{ filebeat_repo_urls['Debian'] }} stable main" cmd: dpkg -i /tmp/graylog-filebeat.deb
state: present changed_when: false
- name: Add filebeat repository (RedHat) - name: install filebeat (RedHat)
ansible.builtin.yum_repository: when: ansible_os_family == 'RedHat'
name: elastic-8.x become: true
description: Elastic Yum Repo 8.x block:
baseurl: "{{ filebeat_repo_urls['RedHat'] }}" - name: Download rpm file (RedHat)
gpgcheck: true ansible.builtin.get_url:
gpgkey: 'https://artifacts.elastic.co/GPG-KEY-elasticsearch' url: "{{ filebeat_repo_urls['RedHat'] }}"
state: present checksum: "sha256:{{ filebeat_checksums['RedHat'] }}"
when: ansible_os_family == 'RedHat' dest: /tmp/graylog-filebeat.rpm
become: true mode: 0644
delegate_to: localhost
run_once: true
- name: Install filebeat package - name: Copy RPM to nodes (RedHat)
ansible.builtin.package: ansible.builtin.copy:
name: filebeat src: /tmp/graylog-filebeat.rpm
state: present dest: /tmp/graylog-filebeat.rpm
become: true mode: 0644
- name: Install rpm (RedHat)
ansible.builtin.yum:
name: /tmp/graylog-filebeat.rpm
state: present
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment