diff --git a/ansible/roles/elastic.beats/.gitignore b/ansible/roles/elastic.beats/.gitignore index 6bc9fb39..fdf3143d 100644 --- a/ansible/roles/elastic.beats/.gitignore +++ b/ansible/roles/elastic.beats/.gitignore @@ -5,4 +5,5 @@ Converging TODO .idea/ -beats.iml \ No newline at end of file +beats.iml +Dockerfile-* \ No newline at end of file diff --git a/ansible/roles/elastic.beats/.kitchen.yml b/ansible/roles/elastic.beats/.kitchen.yml index 2a6641bf..23bf1083 100644 --- a/ansible/roles/elastic.beats/.kitchen.yml +++ b/ansible/roles/elastic.beats/.kitchen.yml @@ -14,14 +14,6 @@ provisioner: idempotency_test: true platforms: - - name: ubuntu-14.04 - driver_config: - image: ubuntu:14.04 - privileged: true - provision_command: - - apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:ansible/ansible - - apt-get update && apt-get -y -q install ansible python-apt python-pycurl - use_sudo: false - name: ubuntu-16.04 driver_config: image: ubuntu:16.04 @@ -39,6 +31,14 @@ platforms: - apt-get update && apt-get -y -q install ansible python-apt python-pycurl - mkdir -p /run/sshd use_sudo: false + - name: ubuntu-20.04 + driver_config: + image: ubuntu:20.04 + privileged: true + provision_command: + - apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:ansible/ansible + - apt-get update && apt-get -y -q install ansible python-apt python-pycurl + use_sudo: false - name: debian-8 driver_config: image: debian:8 @@ -58,6 +58,16 @@ platforms: - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 - apt-get update && apt-get -y install ansible use_sudo: false + - name: debian-10 + driver_config: + image: debian:10 + privileged: true + provision_command: + - apt-get update && apt-get -y install gnupg2 + - echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" > /etc/apt/sources.list.d/ansible.list + - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 + - apt-get update && apt-get -y install ansible + use_sudo: false - name: centos-7 driver_config: image: centos:7 diff --git a/ansible/roles/elastic.beats/CHANGELOG.md b/ansible/roles/elastic.beats/CHANGELOG.md index 438bfd32..a1ad4134 100644 --- a/ansible/roles/elastic.beats/CHANGELOG.md +++ b/ansible/roles/elastic.beats/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 7.12.0 + +* 7.12.0 as default version. +* 6.8.15 as 6.x tested version + + +| PR | Author | Title | +| --- | --- | --- | +| [#138](https://github.com/elastic/ansible-beats/pull/138) | [@jmlrt](https://github.com/jmlrt) | [meta] fix changelog after 7.11.2 release | + + +## 7.11.2 + +* 7.11.2 as default version. + +| PR | Author | Title | +| --- | --- | --- | +| [#135](https://github.com/elastic/ansible-beats/pull/135) | [@v1v](https://github.com/v1v) | Update metadata reference for CentOS 8 | +| [#134](https://github.com/elastic/ansible-beats/pull/134) | [@v1v](https://github.com/v1v) | Remove Ubuntu-14.04 support | +| [#118](https://github.com/elastic/ansible-beats/pull/118) | [@v1v](https://github.com/v1v) | Support ubuntu-20 | +| [#116](https://github.com/elastic/ansible-beats/pull/116) | [@v1v](https://github.com/v1v) | Support debian 10 | +| [#131](https://github.com/elastic/ansible-beats/pull/131) | [@jmlrt](https://github.com/jmlrt) | Copy ILM policy file with root permission | + + ## 7.11.1 * 7.11.1 as default version. diff --git a/ansible/roles/elastic.beats/README.md b/ansible/roles/elastic.beats/README.md index ac1ab572..b42fbf83 100644 --- a/ansible/roles/elastic.beats/README.md +++ b/ansible/roles/elastic.beats/README.md @@ -17,11 +17,12 @@ This role provides a generic means of installing Elastic supported Beats **Tested Platforms** -* Ubuntu 14.04 * Ubuntu 16.04 * Ubuntu 18.04 +* Ubuntu 20.04 * Debian 8 * Debian 9 +* Debian 10 * CentOS 7 * CentOS 8 * Amazon Linux 2 @@ -31,7 +32,7 @@ This role provides a generic means of installing Elastic supported Beats Create your Ansible playbook with your own tasks, and include the role beats. You will have to have this repository accessible within the context of playbook. ```sh -ansible-galaxy install elastic.beats,v7.11.1 +ansible-galaxy install elastic.beats,v7.12.0 ``` Then create your playbook yaml adding the role beats. @@ -44,7 +45,7 @@ The simplest configuration therefore consists of: roles: - role: elastic.beats vars: - beats_version: 7.11.1 + beats_version: 7.12.0 beat: filebeat beat_conf: filebeat: @@ -55,11 +56,11 @@ The simplest configuration therefore consists of: - /var/log/*.log ``` -The above installs Filebeat 7.11.1 on the hosts 'localhost'. +The above installs Filebeat 7.12.0 on the hosts 'localhost'. **Notes**: - Beats default version is described in [`beats_version`](https://github.com/elastic/ansible-beats/blob/master/defaults/main.yml#L4). You can override this variable in your playbook to install another version. -While we are testing this role only with one 7.x and one 6.x version (respectively [7.11.1](https://github.com/elastic/ansible-beats/blob/master/defaults/main.yml#L4) and [6.8.14](https://github.com/elastic/ansible-beats/blob/master/test/integration/standard-6x.yml#L7) at the time of writing), this role should work with others version also in most cases. +While we are testing this role only with one 7.x and one 6.x version (respectively [7.12.0](https://github.com/elastic/ansible-beats/blob/master/defaults/main.yml#L4) and [6.8.15](https://github.com/elastic/ansible-beats/blob/master/test/integration/standard-6x.yml#L7) at the time of writing), this role should work with others version also in most cases. - Beat product is described in `beat` variable. While currently tested Beats are Filebeat, Metricbeat & Packetbeat, this role should work also with other member of [The Beats Family](https://www.elastic.co/products/beats) in most cases. ## Testing @@ -165,7 +166,7 @@ Supported variables are as follows: - **beat** (*MANDATORY*): Beat product. Supported values are: "filebeat", "metricbeat" & "packetbeat" (others beats from [The Beats Family](https://www.elastic.co/products/beats) should work in most cases but aren't currently tested). - **beat_conf** (*MANDATORY*): Beat Configuration. Should be defined as a map. -- **beats_version** (*Defaults to `7.11.1`*): Beats version. +- **beats_version** (*Defaults to `7.12.0`*): Beats version. - **version_lock** (*Defaults to `false`*): Locks the installed version if set to true, thus preventing other processes from updating. This will not impact the roles ability to update the beat on subsequent runs (it unlocks and re-locks if required). - **use_repository** (*Defaults to `true`*): Use elastic repo for yum or apt if true. If false, a custom custom_package_url must be provided. - **beats_add_repository** (*Defaults to `{use_repository}`*): Install elastic repo for yum or apt if true. If false, the present repositories will be used. Useful if you already have beats packages in your repo. diff --git a/ansible/roles/elastic.beats/defaults/main.yml b/ansible/roles/elastic.beats/defaults/main.yml index 3ff9346d..3620eeed 100644 --- a/ansible/roles/elastic.beats/defaults/main.yml +++ b/ansible/roles/elastic.beats/defaults/main.yml @@ -1,6 +1,6 @@ --- # defaults file for beats -beats_version: 7.11.1 +beats_version: 7.12.0 oss_version: false version_lock: false use_repository: true diff --git a/ansible/roles/elastic.beats/meta/.galaxy_install_info b/ansible/roles/elastic.beats/meta/.galaxy_install_info index 37871be1..5bd452bd 100644 --- a/ansible/roles/elastic.beats/meta/.galaxy_install_info +++ b/ansible/roles/elastic.beats/meta/.galaxy_install_info @@ -1,2 +1,2 @@ -install_date: Thu Mar 4 17:26:32 2021 -version: v7.11.1 +install_date: Sat Apr 10 14:18:16 2021 +version: v7.12.0 diff --git a/ansible/roles/elastic.beats/meta/main.yml b/ansible/roles/elastic.beats/meta/main.yml index a97bf55a..db6259a9 100644 --- a/ansible/roles/elastic.beats/meta/main.yml +++ b/ansible/roles/elastic.beats/meta/main.yml @@ -12,8 +12,8 @@ galaxy_info: platforms: - name: EL versions: - - 6 - 7 + - 8 - name: Debian versions: - all diff --git a/ansible/roles/elastic.beats/tasks/beats-config.yml b/ansible/roles/elastic.beats/tasks/beats-config.yml index 273dbed0..a2ce7bae 100644 --- a/ansible/roles/elastic.beats/tasks/beats-config.yml +++ b/ansible/roles/elastic.beats/tasks/beats-config.yml @@ -66,14 +66,22 @@ # Copy default ILM policy file - name: Create default policies config directory + become: yes file: path: '{{ beat_conf.setup.ilm.policy_file | dirname }}' state: directory + mode: 0755 + owner: root + group: root when: default_ilm_policy is defined - name: Copy default ILM policy file for {{ beat }} + become: yes copy: src: '{{default_ilm_policy}}' dest: '{{ beat_conf.setup.ilm.policy_file }}' + mode: 0644 + owner: root + group: root when: default_ilm_policy is defined notify: restart the service diff --git a/ansible/roles/elastic.beats/test/integration/standard-6x.yml b/ansible/roles/elastic.beats/test/integration/standard-6x.yml index 59e43645..912742b7 100644 --- a/ansible/roles/elastic.beats/test/integration/standard-6x.yml +++ b/ansible/roles/elastic.beats/test/integration/standard-6x.yml @@ -12,5 +12,5 @@ input_type: log registry_file: /var/lib/filebeat/registry vars: - beats_version: 6.8.14 + beats_version: 6.8.15 use_repository: "true" diff --git a/ansible/roles/elastic.beats/test/matrix.yml b/ansible/roles/elastic.beats/test/matrix.yml index 0a2f3831..707fc812 100644 --- a/ansible/roles/elastic.beats/test/matrix.yml +++ b/ansible/roles/elastic.beats/test/matrix.yml @@ -1,10 +1,11 @@ --- OS: - - ubuntu-1404 - ubuntu-1604 - ubuntu-1804 + - ubuntu-2004 - debian-8 - debian-9 + - debian-10 - centos-7 - centos-8 - amazonlinux-2