diff --git a/.config/molecule/config.yml b/.config/molecule/config.yml index 5983d8656..6ea6f0ad2 100644 --- a/.config/molecule/config.yml +++ b/.config/molecule/config.yml @@ -61,6 +61,9 @@ provisioner: exclude_ansible_vers: - "2.17" - "2.18" + ubuntu-20.04: + exclude_ansible_vers: + - "2.18" ubuntu-24.04: exclude_ansible_vers: - "2.9" diff --git a/.github/workflows/ansible-ci.yml b/.github/workflows/ansible-ci.yml index b46377ae2..4aaf18fe7 100644 --- a/.github/workflows/ansible-ci.yml +++ b/.github/workflows/ansible-ci.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Lint collection - uses: ansible/ansible-lint@6a4fcdb135dd2be6e8ee5ddb5bf59d3d78cbe7b0 # v25.2.0 + uses: ansible/ansible-lint@c16f018b1bdfdea6717f4b5b1b141a78b86021cd # v25.2.1 with: requirements_file: requirements.yml @@ -45,7 +45,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Run action - uses: hoo29/little-timmy@v2-action + uses: hoo29/little-timmy@c8ca5086db961499fc3d4e37637f566c3d0ec6d6 # v3-action discover-ansible-versions: runs-on: ubuntu-latest diff --git a/.github/workflows/ansible-test-integration.yml b/.github/workflows/ansible-test-integration.yml index a9e556af8..8fbfbea92 100644 --- a/.github/workflows/ansible-test-integration.yml +++ b/.github/workflows/ansible-test-integration.yml @@ -33,7 +33,7 @@ jobs: name: "${{ matrix.targets.name }}-${{ matrix.ansible-core-versions }}" steps: - name: "Perform ${{ matrix.targets.test }} integration test with ansible-test" - uses: ansible-community/ansible-test-gh-action@e083357d3acff9e6631b0ad08d8ca4421e5a75d3 # v1.16.0 + uses: ansible-community/ansible-test-gh-action@b416b6ecf7ddb0ea3b0a51c1d198d715eba52c9d # v1.16.0 with: ansible-core-version: ${{ matrix.ansible-core-versions }} target-python-version: ${{ matrix.target-python-versions }} diff --git a/.github/workflows/ansible-test-sanity.yml b/.github/workflows/ansible-test-sanity.yml index aff8cbd41..e3e9bfcff 100644 --- a/.github/workflows/ansible-test-sanity.yml +++ b/.github/workflows/ansible-test-sanity.yml @@ -19,7 +19,7 @@ jobs: name: "sanity-${{ matrix.ansible-core-versions }}" steps: - name: "Perform sanity test with ansible-test" - uses: ansible-community/ansible-test-gh-action@e083357d3acff9e6631b0ad08d8ca4421e5a75d3 # v1.16.0 + uses: ansible-community/ansible-test-gh-action@b416b6ecf7ddb0ea3b0a51c1d198d715eba52c9d # v1.16.0 with: ansible-core-version: ${{ matrix.ansible-core-versions }} testing-type: sanity diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 533d51931..b6cfd148e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,7 @@ jobs: uses: ansible-community/github-action-build-collection@main - name: "Upload built collection to release" - uses: svenstaro/upload-release-action@2b4adf59f26ea3ed6ddecb8e00f80acc6bc16bd4 # 2.9.0 + uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ steps.build-collection.outputs.artifact-filename }} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2d80508df..4ec6c616d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,9 @@ Prometheus.Prometheus Release Notes .. contents:: Topics +v0.26.2 +======= + v0.26.1 ======= diff --git a/changelogs/.plugin-cache.yaml b/changelogs/.plugin-cache.yaml index 99427d8a6..3eab6f101 100644 --- a/changelogs/.plugin-cache.yaml +++ b/changelogs/.plugin-cache.yaml @@ -120,4 +120,4 @@ plugins: strategy: {} test: {} vars: {} -version: 0.26.1 +version: 0.26.2 diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index d135c3f8a..3cded6bc4 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -1,10 +1,13 @@ --- ancestor: releases: - 0.26.1: + 0.26.2: changes: trivial: - - 'chore(deps): update ansible/ansible-lint action to v25.2.0 (https://github.com/prometheus-community/ansible/pull/569)' + - 'patch: New prometheus/prometheus upstream release 3.3.0! (https://github.com/prometheus-community/ansible/pull/580)' + - 'chore(deps): update hoo29/little-timmy action to v3 (https://github.com/prometheus-community/ansible/pull/578)' + release_date: '2025-04-18' + 0.26.1: release_date: '2025-04-02' 0.26.0: changes: diff --git a/galaxy.yml b/galaxy.yml index 4be1c77a7..a47d55194 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,7 +1,7 @@ --- namespace: prometheus name: prometheus -version: 0.26.1 +version: 0.26.2 readme: README.md authors: - "Ben Kochie (https://github.com/SuperQ)" diff --git a/roles/alertmanager/defaults/main.yml b/roles/alertmanager/defaults/main.yml index fd0a3b57a..cd3984561 100644 --- a/roles/alertmanager/defaults/main.yml +++ b/roles/alertmanager/defaults/main.yml @@ -1,5 +1,5 @@ --- -alertmanager_version: 0.28.0 +alertmanager_version: 0.28.1 alertmanager_binary_url: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/\ alertmanager-{{ alertmanager_version }}.{{ ansible_facts['system'] | lower }}-{{ _alertmanager_go_ansible_arch }}.tar.gz" alertmanager_checksums_url: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/sha256sums.txt" diff --git a/roles/alertmanager/meta/argument_specs.yml b/roles/alertmanager/meta/argument_specs.yml index 748024475..a44dcbe0f 100644 --- a/roles/alertmanager/meta/argument_specs.yml +++ b/roles/alertmanager/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: alertmanager_version: description: "Alertmanager package version. Also accepts `latest` as parameter." - default: 0.28.0 + default: 0.28.1 alertmanager_binary_url: description: "URL of the alertmanager binaries .tar.gz file" default: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/alertmanager-{{ alertmanager_version }}.{{ ansible_facts['system'] | lower }}-{{ _alertmanager_go_ansible_arch }}.tar.gz" diff --git a/roles/apache_exporter/defaults/main.yml b/roles/apache_exporter/defaults/main.yml index fc8f9934a..56179ad03 100644 --- a/roles/apache_exporter/defaults/main.yml +++ b/roles/apache_exporter/defaults/main.yml @@ -1,5 +1,5 @@ --- -apache_exporter_version: 1.0.9 +apache_exporter_version: 1.0.10 apache_exporter_binary_url: "https://github.com/{{ _apache_exporter_repo }}/releases/download/v{{ apache_exporter_version }}/\ apache_exporter-{{ apache_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _apache_exporter_go_ansible_arch }}.tar.gz" apache_exporter_checksums_url: "https://github.com/{{ _apache_exporter_repo }}/releases/download/v{{ apache_exporter_version }}/sha256sums.txt" diff --git a/roles/apache_exporter/meta/argument_specs.yml b/roles/apache_exporter/meta/argument_specs.yml index b7c9f1a9f..7ac9baaf1 100644 --- a/roles/apache_exporter/meta/argument_specs.yml +++ b/roles/apache_exporter/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: apache_exporter_version: description: "apache_exporter package version. Also accepts latest as parameter." - default: "1.0.9" + default: "1.0.10" apache_exporter_binary_url: description: "URL of the apache_exporter binaries .tar.gz file" default: "https://github.com/{{ _apache_exporter_repo }}/releases/download/v{{ apache_exporter_version }}/apache_exporter_{{ apache_exporter_version }}_{{ ansible_facts['system'] | lower }}-{{ _apache_exporter_go_ansible_arch }}.tar.gz" diff --git a/roles/cadvisor/defaults/main.yml b/roles/cadvisor/defaults/main.yml index d1a77f2dd..31c489776 100644 --- a/roles/cadvisor/defaults/main.yml +++ b/roles/cadvisor/defaults/main.yml @@ -1,5 +1,5 @@ --- -cadvisor_version: 0.49.2 +cadvisor_version: 0.52.1 cadvisor_binary_url: "https://github.com/{{ _cadvisor_repo }}/releases/download/v{{ cadvisor_version }}/\ cadvisor-v{{ cadvisor_version }}-{{ ansible_facts['system'] | lower }}-{{ _cadvisor_go_ansible_arch }}" diff --git a/roles/cadvisor/meta/argument_specs.yml b/roles/cadvisor/meta/argument_specs.yml index e44a32b82..017b6751a 100644 --- a/roles/cadvisor/meta/argument_specs.yml +++ b/roles/cadvisor/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: cadvisor_version: description: "cAdvisor package version. Also accepts latest as parameter." - default: "0.49.2" + default: "0.52.1" cadvisor_binary_url: description: "URL of the cadvisor binary file" default: "https://github.com/{{ _cadvisor_repo }}/releases/download/v{{ cadvisor_version }}/cadvisor-v{{ cadvisor_version }}-{{ ansible_facts['system'] | lower }}-{{ _cadvisor_go_ansible_arch }}" diff --git a/roles/elasticsearch_exporter/README.md b/roles/elasticsearch_exporter/README.md new file mode 100644 index 000000000..695d31261 --- /dev/null +++ b/roles/elasticsearch_exporter/README.md @@ -0,0 +1,45 @@ +# Ansible Role: elasticsearch exporter + +## Description + +Deploy prometheus [elasticsearch exporter](https://github.com/prometheus-community/elasticsearch_exporter) using ansible. + +Grafana dashboard example: https://github.com/prometheus-community/elasticsearch_exporter/blob/master/examples/grafana/dashboard.json + +## Requirements + +- Ansible >= 2.9 (It might work on previous versions, but we cannot guarantee it) +- gnu-tar on Mac deployer host (`brew install gnu-tar`) +- Passlib is required when using the basic authentication feature (`pip install passlib[bcrypt]`) + +## Role Variables + +All variables which can be overridden are stored in [defaults/main.yml](defaults/main.yml) file as well as in [meta/argument_specs.yml](meta/argument_specs.yml). +Please refer to the [collection docs](https://prometheus-community.github.io/ansible/branch/main/elasticsearch_exporter_role.html) for description and default values of the variables. + +## Example + +### Playbook + +Use it in a playbook as follows: +```yaml +- hosts: all + roles: + - prometheus.prometheus.elasticsearch_exporter +``` + +## Local Testing + +The preferred way of locally testing the role is to use Docker and [molecule](https://github.com/ansible-community/molecule) (v3.x). You will have to install Docker on your system. See "Get started" for a Docker package suitable for your system. Running your tests is as simple as executing `molecule test`. + +## Contributing + +See [contributor guideline](CONTRIBUTING.md). + +## Troubleshooting + +See [troubleshooting](TROUBLESHOOTING.md). + +## License + +This project is licensed under MIT License. See [LICENSE](/LICENSE) for more details. diff --git a/roles/elasticsearch_exporter/TROUBLESHOOTING.md b/roles/elasticsearch_exporter/TROUBLESHOOTING.md new file mode 100644 index 000000000..4f341277d --- /dev/null +++ b/roles/elasticsearch_exporter/TROUBLESHOOTING.md @@ -0,0 +1 @@ +# Troubleshooting diff --git a/roles/elasticsearch_exporter/defaults/main.yml b/roles/elasticsearch_exporter/defaults/main.yml new file mode 100644 index 000000000..dd25deeaa --- /dev/null +++ b/roles/elasticsearch_exporter/defaults/main.yml @@ -0,0 +1,37 @@ +--- +elasticsearch_exporter_version: 1.8.0 +elasticsearch_exporter_binary_url: "https://github.com/{{ _elasticsearch_exporter_repo }}/releases/download/v{{ elasticsearch_exporter_version }}/\ + elasticsearch_exporter-{{ elasticsearch_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _elasticsearch_exporter_go_ansible_arch }}.tar.gz" +elasticsearch_exporter_checksums_url: "https://github.com/{{ _elasticsearch_exporter_repo }}/releases/download/v{{ elasticsearch_exporter_version }}/sha256sums.txt" + +elasticsearch_exporter_web_disable_exporter_metrics: false +elasticsearch_exporter_web_listen_address: "0.0.0.0:9114" +elasticsearch_exporter_web_telemetry_path: "/metrics" + +elasticsearch_exporter_textfile_dir: "/var/lib/elasticsearch_exporter" + +elasticsearch_exporter_tls_server_config: {} + +elasticsearch_exporter_http_server_config: {} + +elasticsearch_exporter_basic_auth_users: {} + +elasticsearch_exporter_enabled_collectors: + - systemd + - textfile: + directory: "{{ elasticsearch_exporter_textfile_dir }}" +# - filesystem: +# ignored-mount-points: "^/(sys|proc|dev)($|/)" +# ignored-fs-types: "^(sys|proc|auto)fs$" + +elasticsearch_exporter_disabled_collectors: [] + +elasticsearch_exporter_binary_install_dir: "/usr/local/bin" +elasticsearch_exporter_system_group: "elastic-exp" +elasticsearch_exporter_system_user: "{{ elasticsearch_exporter_system_group }}" +# systemd cli extra arguments +elasticsearch_exporter_extra_args: [] + +elasticsearch_exporter_config_dir: "/etc/elasticsearch_exporter" +# Local path to stash the archive and its extraction +elasticsearch_exporter_local_cache_path: "/tmp/elasticsearch_exporter-{{ ansible_facts['system'] | lower }}-{{ _elasticsearch_exporter_go_ansible_arch }}/{{ elasticsearch_exporter_version }}" diff --git a/roles/elasticsearch_exporter/handlers/main.yml b/roles/elasticsearch_exporter/handlers/main.yml new file mode 100644 index 000000000..7c16b8bb4 --- /dev/null +++ b/roles/elasticsearch_exporter/handlers/main.yml @@ -0,0 +1,10 @@ +--- +- name: Restart elasticsearch_exporter + listen: "restart elasticsearch_exporter" + become: true + ansible.builtin.systemd: + daemon_reload: true + name: elasticsearch_exporter + state: restarted + when: + - not ansible_check_mode diff --git a/roles/elasticsearch_exporter/meta/argument_specs.yml b/roles/elasticsearch_exporter/meta/argument_specs.yml new file mode 100644 index 000000000..49335bfb9 --- /dev/null +++ b/roles/elasticsearch_exporter/meta/argument_specs.yml @@ -0,0 +1,89 @@ +--- +# yamllint disable rule:line-length +argument_specs: + main: + short_description: "Prometheus Elasticsearch Exporter" + description: + - "Deploy prometheus L(elasticsearch exporter,https://github.com/prometheus-community/elasticsearch_exporter) using ansible" + author: + - "Prometheus Community" + options: + elasticsearch_exporter_version: + description: "Elasticsearch exporter package version. Also accepts latest as parameter." + default: "1.8.0" + elasticsearch_exporter_binary_url: + description: "URL of the elasticsearch exporter binaries .tar.gz file" + default: "https://github.com/{{ _elasticsearch_exporter_repo }}/releases/download/v{{ elasticsearch_exporter_version }}/elasticsearch_exporter-{{ elasticsearch_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _elasticsearch_exporter_go_ansible_arch }}.tar.gz" + elasticsearch_exporter_checksums_url: + description: "URL of the elasticsearch exporter checksums file" + default: "https://github.com/{{ _elasticsearch_exporter_repo }}/releases/download/v{{ elasticsearch_exporter_version }}/sha256sums.txt" + elasticsearch_exporter_web_disable_exporter_metrics: + description: "Exclude metrics about the exporter itself (promhttp_*, process_*, go_*)." + type: bool + default: false + elasticsearch_exporter_web_listen_address: + description: "Address on which elasticsearch exporter will listen" + default: "0.0.0.0:9114" + elasticsearch_exporter_web_telemetry_path: + description: "Path under which to expose metrics" + default: "/metrics" + elasticsearch_exporter_enabled_collectors: + description: + - "List of dicts defining additionally enabled collectors and their configuration." + - "It adds collectors to L(those enabled by default,https://github.com/prometheus/elasticsearch_exporter#enabled-by-default)." + type: "list" + default: + - systemd + - textfile: + directory: "{{ elasticsearch_exporter_textfile_dir }}" + elasticsearch_exporter_disabled_collectors: + description: + - "List of disabled collectors." + - "By default elasticsearch_exporter disables collectors listed L(here,https://github.com/prometheus/elasticsearch_exporter#disabled-by-default)." + type: "list" + elements: "str" + elasticsearch_exporter_textfile_dir: + description: + - "Directory used by the L(Textfile Collector,https://github.com/prometheus/elasticsearch_exporter#textfile-collector)." + - "To get permissions to write metrics in this directory, users must be in C(elastic-exp) system group." + - "B(Note:) More information in TROUBLESHOOTING.md guide." + default: "/var/lib/elasticsearch_exporter" + elasticsearch_exporter_tls_server_config: + description: + - "Configuration for TLS authentication." + - "Keys and values are the same as in L(elasticsearch_exporter docs,https://prometheus.io/docs/prometheus/latest/configuration/https/)." + type: "dict" + elasticsearch_exporter_http_server_config: + description: + - "Config for HTTP/2 support." + - "Keys and values are the same as in L(elasticsearch_exporter docs,https://prometheus.io/docs/prometheus/latest/configuration/https/)." + type: "dict" + elasticsearch_exporter_basic_auth_users: + description: "Dictionary of users and password for basic authentication. Passwords are automatically hashed with bcrypt." + type: "dict" + elasticsearch_exporter_binary_install_dir: + description: + - "I(Advanced)" + - "Directory to install elasticsearch_exporter binary" + default: "/usr/local/bin" + elasticsearch_exporter_system_group: + description: + - "I(Advanced)" + - "System group for elasticsearch exporter" + default: "elastic-exp" + elasticsearch_exporter_system_user: + description: + - "I(Advanced)" + - "Elasticsearch exporter user" + default: "elastic-exp" + elasticsearch_exporter_extra_args: + description: + - "I(Advanced)" + - "Elasticsearch exporter cli extra arguments to be added to systemd unit" + default: [] + elasticsearch_exporter_local_cache_path: + description: "Local path to stash the archive and its extraction" + default: "/tmp/elasticsearch_exporter-{{ ansible_facts['system'] | lower }}-{{ _elasticsearch_exporter_go_ansible_arch }}/{{ elasticsearch_exporter_version }}" + elasticsearch_exporter_config_dir: + description: "Path to directory with elasticsearch_exporter configuration" + default: "/etc/elasticsearch_exporter" diff --git a/roles/elasticsearch_exporter/meta/main.yml b/roles/elasticsearch_exporter/meta/main.yml new file mode 100644 index 000000000..3512fdd96 --- /dev/null +++ b/roles/elasticsearch_exporter/meta/main.yml @@ -0,0 +1,25 @@ +--- +galaxy_info: + author: "Prometheus Community" + description: "Prometheus Elasticsearch Exporter" + license: "Apache" + min_ansible_version: "2.9" + platforms: + - name: "Ubuntu" + versions: + - "focal" + - "jammy" + - "noble" + - name: "Debian" + versions: + - "bullseye" + - name: "EL" + versions: + - "8" + - "9" + galaxy_tags: + - "monitoring" + - "prometheus" + - "exporter" + - "metrics" + - "system" diff --git a/roles/elasticsearch_exporter/molecule/alternative/molecule.yml b/roles/elasticsearch_exporter/molecule/alternative/molecule.yml new file mode 100644 index 000000000..a09959be0 --- /dev/null +++ b/roles/elasticsearch_exporter/molecule/alternative/molecule.yml @@ -0,0 +1,26 @@ +--- +provisioner: + playbooks: + prepare: "${MOLECULE_PROJECT_DIRECTORY}/../../.config/molecule/alternative/prepare.yml" + inventory: + group_vars: + all: + elasticsearch_exporter_local_cache_path: "/tmp/elasticsearch_exporter-linux-amd64" + elasticsearch_exporter_web_listen_address: + - '127.0.0.1:8080' + - '127.0.1.1:8080' + elasticsearch_exporter_textfile_dir: "" + elasticsearch_exporter_enabled_collectors: + - entropy + elasticsearch_exporter_disabled_collectors: + - diskstats + elasticsearch_exporter_tls_server_config: + cert_file: /etc/elasticsearch_exporter/tls.cert + key_file: /etc/elasticsearch_exporter/tls.key + elasticsearch_exporter_http_server_config: + http2: true + elasticsearch_exporter_basic_auth_users: + randomuser: examplepassword + elasticsearch_exporter_version: 1.8.0 + elasticsearch_exporter_binary_url: "https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v{{\ + \ elasticsearch_exporter_version }}/elasticsearch_exporter-{{ elasticsearch_exporter_version }}.linux-amd64.tar.gz" diff --git a/roles/elasticsearch_exporter/molecule/alternative/tests/test_alternative.py b/roles/elasticsearch_exporter/molecule/alternative/tests/test_alternative.py new file mode 100644 index 000000000..7121f78b6 --- /dev/null +++ b/roles/elasticsearch_exporter/molecule/alternative/tests/test_alternative.py @@ -0,0 +1,43 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from testinfra_helpers import get_target_hosts +import pytest + +testinfra_hosts = get_target_hosts() + + +def test_directories(host): + dirs = [ + "/var/lib/elasticsearch_exporter" + ] + for dir in dirs: + d = host.file(dir) + assert not d.exists + + +def test_service(host): + s = host.service("elasticsearch_exporter") + try: + assert s.is_running + except AssertionError: + # Capture service logs + journal_output = host.run('journalctl -u elasticsearch_exporter --since "1 hour ago"') + print("\n==== journalctl -u elasticsearch_exporter Output ====\n") + print(journal_output) + print("\n============================================\n") + raise # Re-raise the original assertion error + + +def test_protecthome_property(host): + s = host.service("elasticsearch_exporter") + p = s.systemd_properties + assert p.get("ProtectHome") == "yes" + + +@pytest.mark.parametrize("sockets", [ + "tcp://127.0.0.1:8080", + "tcp://127.0.1.1:8080", +]) +def test_socket(host, sockets): + assert host.socket(sockets).is_listening diff --git a/roles/elasticsearch_exporter/molecule/default/molecule.yml b/roles/elasticsearch_exporter/molecule/default/molecule.yml new file mode 100644 index 000000000..97776d920 --- /dev/null +++ b/roles/elasticsearch_exporter/molecule/default/molecule.yml @@ -0,0 +1,6 @@ +--- +provisioner: + inventory: + group_vars: + all: + elasticsearch_exporter_web_listen_address: "127.0.0.1:9114" diff --git a/roles/elasticsearch_exporter/molecule/default/tests/test_default.py b/roles/elasticsearch_exporter/molecule/default/tests/test_default.py new file mode 100644 index 000000000..414559082 --- /dev/null +++ b/roles/elasticsearch_exporter/molecule/default/tests/test_default.py @@ -0,0 +1,76 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from testinfra_helpers import get_target_hosts + +testinfra_hosts = get_target_hosts() + + +def test_directories(host): + dirs = [ + "/var/lib/elasticsearch_exporter" + ] + for dir in dirs: + d = host.file(dir) + assert d.is_directory + assert d.exists + + +def test_files(host): + files = [ + "/etc/systemd/system/elasticsearch_exporter.service", + "/usr/local/bin/elasticsearch_exporter" + ] + for file in files: + f = host.file(file) + assert f.exists + assert f.is_file + + +def test_permissions_didnt_change(host): + dirs = [ + "/etc", + "/root", + "/usr", + "/var" + ] + for file in dirs: + f = host.file(file) + assert f.exists + assert f.is_directory + assert f.user == "root" + assert f.group == "root" + + +def test_user(host): + assert host.group("elastic-exp").exists + assert "elastic-exp" in host.user("elastic-exp").groups + assert host.user("elastic-exp").shell == "/usr/sbin/nologin" + + +def test_service(host): + s = host.service("elasticsearch_exporter") + try: + assert s.is_running + except AssertionError: + # Capture service logs + journal_output = host.run('journalctl -u elasticsearch_exporter --since "1 hour ago"') + print("\n==== journalctl -u elasticsearch_exporter Output ====\n") + print(journal_output) + print("\n============================================\n") + raise # Re-raise the original assertion error + + +def test_protecthome_property(host): + s = host.service("elasticsearch_exporter") + p = s.systemd_properties + assert p.get("ProtectHome") == "yes" + + +def test_socket(host): + sockets = [ + "tcp://127.0.0.1:9114" + ] + for socket in sockets: + s = host.socket(socket) + assert s.is_listening diff --git a/roles/elasticsearch_exporter/molecule/latest/molecule.yml b/roles/elasticsearch_exporter/molecule/latest/molecule.yml new file mode 100644 index 000000000..9fec08ac9 --- /dev/null +++ b/roles/elasticsearch_exporter/molecule/latest/molecule.yml @@ -0,0 +1,7 @@ +--- +provisioner: + inventory: + group_vars: + all: + elasticsearch_exporter_version: latest + elasticsearch_exporter_textfile_dir: /home/elasticsearch_exporter diff --git a/roles/elasticsearch_exporter/molecule/latest/tests/test_latest.py b/roles/elasticsearch_exporter/molecule/latest/tests/test_latest.py new file mode 100644 index 000000000..64c261087 --- /dev/null +++ b/roles/elasticsearch_exporter/molecule/latest/tests/test_latest.py @@ -0,0 +1,51 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from testinfra_helpers import get_target_hosts +import pytest + +testinfra_hosts = get_target_hosts() + + +@pytest.mark.parametrize("files", [ + "/etc/systemd/system/elasticsearch_exporter.service", + "/usr/local/bin/elasticsearch_exporter" +]) +def test_files(host, files): + f = host.file(files) + assert f.exists + assert f.is_file + + +def test_directories(host): + dirs = [ + "/home/elasticsearch_exporter" + ] + for dir in dirs: + d = host.file(dir) + assert d.is_directory + assert d.exists + + +def test_service(host): + s = host.service("elasticsearch_exporter") + try: + assert s.is_running + except AssertionError: + # Capture service logs + journal_output = host.run('journalctl -u elasticsearch_exporter --since "1 hour ago"') + print("\n==== journalctl -u elasticsearch_exporter Output ====\n") + print(journal_output) + print("\n============================================\n") + raise # Re-raise the original assertion error + + +def test_protecthome_property(host): + s = host.service("elasticsearch_exporter") + p = s.systemd_properties + assert p.get("ProtectHome") == "read-only" + + +def test_socket(host): + s = host.socket("tcp://0.0.0.0:9114") + assert s.is_listening diff --git a/roles/elasticsearch_exporter/tasks/configure.yml b/roles/elasticsearch_exporter/tasks/configure.yml new file mode 100644 index 000000000..1f2a12581 --- /dev/null +++ b/roles/elasticsearch_exporter/tasks/configure.yml @@ -0,0 +1,30 @@ +--- +- name: Configure + ansible.builtin.include_role: + name: prometheus.prometheus._common + tasks_from: configure.yml + vars: + _common_system_user: "{{ elasticsearch_exporter_system_user }}" + _common_system_group: "{{ elasticsearch_exporter_system_group }}" + _common_config_dir: "{{ elasticsearch_exporter_config_dir }}" + _common_tls_server_config: "{{ elasticsearch_exporter_tls_server_config }}" + _common_http_server_config: "{{ elasticsearch_exporter_http_server_config }}" + _common_basic_auth_users: "{{ elasticsearch_exporter_basic_auth_users }}" + tags: + - elasticsearch_exporter + - configure + - elasticsearch_exporter_configure + +- name: Create textfile collector dir + ansible.builtin.file: + path: "{{ elasticsearch_exporter_textfile_dir }}" + state: directory + owner: "{{ elasticsearch_exporter_system_user }}" + group: "{{ elasticsearch_exporter_system_group }}" + mode: u+rwX,g+rwX,o=rX + become: true + when: elasticsearch_exporter_textfile_dir | length > 0 + tags: + - elasticsearch_exporter + - configure + - elasticsearch_exporter_configure diff --git a/roles/elasticsearch_exporter/tasks/main.yml b/roles/elasticsearch_exporter/tasks/main.yml new file mode 100644 index 000000000..b11349d96 --- /dev/null +++ b/roles/elasticsearch_exporter/tasks/main.yml @@ -0,0 +1,53 @@ +--- +- name: Preflight + ansible.builtin.include_tasks: + file: preflight.yml + tags: + - elasticsearch_exporter_install + - elasticsearch_exporter_configure + - elasticsearch_exporter_run + +- name: Install + ansible.builtin.include_role: + name: prometheus.prometheus._common + tasks_from: install.yml + vars: + _common_local_cache_path: "{{ elasticsearch_exporter_local_cache_path }}" + _common_binaries: "{{ _elasticsearch_exporter_binaries }}" + _common_binary_install_dir: "{{ elasticsearch_exporter_binary_install_dir }}" + _common_binary_url: "{{ elasticsearch_exporter_binary_url }}" + _common_checksums_url: "{{ elasticsearch_exporter_checksums_url }}" + _common_system_group: "{{ elasticsearch_exporter_system_group }}" + _common_system_user: "{{ elasticsearch_exporter_system_user }}" + _common_config_dir: "{{ elasticsearch_exporter_config_dir }}" + _common_binary_unarchive_opts: ['--strip-components=1'] + tags: + - elasticsearch_exporter_install + +- name: SELinux + ansible.builtin.include_role: + name: prometheus.prometheus._common + tasks_from: selinux.yml + vars: + _common_selinux_port: "{{ elasticsearch_exporter_web_listen_address | urlsplit('port') }}" + when: ansible_facts['selinux'].status == "enabled" + tags: + - elasticsearch_exporter_configure + +- name: Configure + ansible.builtin.include_tasks: + file: configure.yml + tags: + - elasticsearch_exporter_configure + +- name: Ensure Node Exporter is enabled on boot + become: true + ansible.builtin.systemd: + daemon_reload: true + name: elasticsearch_exporter + enabled: true + state: started + when: + - not ansible_check_mode + tags: + - elasticsearch_exporter_run diff --git a/roles/elasticsearch_exporter/tasks/preflight.yml b/roles/elasticsearch_exporter/tasks/preflight.yml new file mode 100644 index 000000000..e08962765 --- /dev/null +++ b/roles/elasticsearch_exporter/tasks/preflight.yml @@ -0,0 +1,65 @@ +--- +- name: Common preflight + ansible.builtin.include_role: + name: prometheus.prometheus._common + tasks_from: preflight.yml + vars: + _common_web_listen_address: "{{ elasticsearch_exporter_web_listen_address }}" + +- name: Assert that used version supports listen address type + ansible.builtin.assert: + that: + - >- + elasticsearch_exporter_web_listen_address is string + or + ( + elasticsearch_exporter_version is version('1.5.0', '>=') and + elasticsearch_exporter_web_listen_address | type_debug == "list" + ) + +- name: Assert collectors are not both disabled and enabled at the same time + ansible.builtin.assert: + that: + - "item not in elasticsearch_exporter_enabled_collectors" + with_items: "{{ elasticsearch_exporter_disabled_collectors }}" + +- name: Assert that TLS config is correct + when: elasticsearch_exporter_tls_server_config | length > 0 + block: + - name: Assert that TLS key and cert path are set + ansible.builtin.assert: + that: + - "elasticsearch_exporter_tls_server_config.cert_file is defined" + - "elasticsearch_exporter_tls_server_config.key_file is defined" + + - name: Check existence of TLS cert file + ansible.builtin.stat: + path: "{{ elasticsearch_exporter_tls_server_config.cert_file }}" + register: __elasticsearch_exporter_cert_file + + - name: Check existence of TLS key file + ansible.builtin.stat: + path: "{{ elasticsearch_exporter_tls_server_config.key_file }}" + register: __elasticsearch_exporter_key_file + + - name: Assert that TLS key and cert are present + ansible.builtin.assert: + that: + - "__elasticsearch_exporter_cert_file.stat.exists" + - "__elasticsearch_exporter_key_file.stat.exists" + +- name: Discover latest version + ansible.builtin.set_fact: + elasticsearch_exporter_version: "{{ (lookup('url', 'https://api.github.com/repos/{{ _elasticsearch_exporter_repo }}/releases/latest', headers=_github_api_headers, + split_lines=False) | from_json).get('tag_name') | replace('v', '') }}" + run_once: true + until: elasticsearch_exporter_version is version('0.0.0', '>=') + retries: 10 + when: + - elasticsearch_exporter_version == "latest" + tags: + - elasticsearch_exporter + - install + - elasticsearch_exporter_install + - download + - elasticsearch_exporter_download diff --git a/roles/elasticsearch_exporter/templates/elasticsearch_exporter.service.j2 b/roles/elasticsearch_exporter/templates/elasticsearch_exporter.service.j2 new file mode 100644 index 000000000..1bd2906bd --- /dev/null +++ b/roles/elasticsearch_exporter/templates/elasticsearch_exporter.service.j2 @@ -0,0 +1,126 @@ +{{ ansible_managed | comment }} + +# Exposure level `systemd-analyze security`: 2.7 OK + +[Unit] +Description=Prometheus Elasticsearch Exporter +After=network-online.target + +[Service] +Type=simple +User={{ elasticsearch_exporter_system_user }} +Group={{ elasticsearch_exporter_system_group }} +ExecStart={{ elasticsearch_exporter_binary_install_dir }}/elasticsearch_exporter \ +{% if elasticsearch_exporter_tls_server_config | length > 0 or elasticsearch_exporter_http_server_config | length > 0 or elasticsearch_exporter_basic_auth_users | length > 0 %} + {% if elasticsearch_exporter_version is version('1.5.0', '>=') %} + '--web.config.file={{ elasticsearch_exporter_config_dir }}/web_config.yml' \ + {% else %} + '--web.config={{ elasticsearch_exporter_config_dir }}/web_config.yml' \ + {% endif %} +{% endif %} +{% if elasticsearch_exporter_web_disable_exporter_metrics %} + '--web.disable-exporter-metrics' \ +{% endif %} +{% if elasticsearch_exporter_version is version('1.5.0', '>=') and + elasticsearch_exporter_web_listen_address is iterable and + elasticsearch_exporter_web_listen_address is not mapping and + elasticsearch_exporter_web_listen_address is not string %} +{% for address in elasticsearch_exporter_web_listen_address %} + '--web.listen-address={{ address }}' \ +{% endfor %} +{% else %} + '--web.listen-address={{ elasticsearch_exporter_web_listen_address }}' \ +{% endif %} +{% if elasticsearch_exporter_extra_args is iterable and + elasticsearch_exporter_extra_args is not mapping and + elasticsearch_exporter_extra_args is not string %} +{% for item in elasticsearch_exporter_extra_args %} + '{{ item }}' \ +{% endfor %} +{% else %} + '{{ elasticsearch_exporter_extra_args }}' \ +{% endif %} + '--web.telemetry-path={{ elasticsearch_exporter_web_telemetry_path }}' + +SyslogIdentifier=elasticsearch_exporter +Restart=always +RestartSec=1 +StartLimitInterval=0 + +{% set ns = namespace(protect_home = 'yes') %} +{% for m in ansible_facts['mounts'] if m.mount.startswith('/home') %} +{% set ns.protect_home = 'read-only' %} +{% endfor %} +{% if elasticsearch_exporter_textfile_dir.startswith('/home') %} +{% set ns.protect_home = 'read-only' %} +{% endif %} +ProtectHome={{ ns.protect_home }} +NoNewPrivileges=yes +PrivateTmp=true +UMask=077 + +{% if (ansible_facts.packages.systemd | first).version is version('232', '>=') %} +ProtectSystem=strict +ProtectProc=noaccess +ProtectControlGroups=true +ProtectKernelModules=true +ProtectKernelTunables=yes +ProtectHostname=yes +ProtectClock=yes +LockPersonality=true +RestrictRealtime=true +RestrictNamespaces=yes +RestrictSUIDSGID=yes +MemoryDenyWriteExecute=yes +RemoveIPC=yes +{% else %} +ProtectSystem=full +{% endif %} + +IPAccounting=yes +IPAddressAllow=localhost link-local multicast 10.0.0.0/8 192.168.0.0/16 +# IPAddressDeny= + +CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_DAC_READ_SEARCH +CapabilityBoundingSet=~CAP_BLOCK_SUSPEND +CapabilityBoundingSet=~CAP_BPF +CapabilityBoundingSet=~CAP_DAC_* CAP_FOWNER CAP_IPC_OWNER +CapabilityBoundingSet=~CAP_FSETID CAP_SETFCAP +CapabilityBoundingSet=~CAP_IPC_LOCK +CapabilityBoundingSet=~CAP_KILL +CapabilityBoundingSet=~CAP_LEASE +CapabilityBoundingSet=~CAP_LINUX_IMMUTABLE +CapabilityBoundingSet=~CAP_MKNOD +CapabilityBoundingSet=~CAP_NET_ADMIN +CapabilityBoundingSet=~CAP_NET_BIND_SERVICE CAP_NET_BROADCAST +CapabilityBoundingSet=~CAP_NET_RAW +CapabilityBoundingSet=~CAP_SETUID CAP_SETGID CAP_SETPCAP +CapabilityBoundingSet=~CAP_SYS_CHROOT +CapabilityBoundingSet=~CAP_SYS_PACCT +CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG +CapabilityBoundingSet=~CAP_SYS_ADMIN +CapabilityBoundingSet=~CAP_SYS_NICE CAP_SYS_RESOURCE +CapabilityBoundingSet=~CAP_SYS_BOOT +CapabilityBoundingSet=~CAP_SYS_RAWIO +CapabilityBoundingSet=~CAP_SYS_PTRACE + +{% if not (ansible_virtualization_type is defined and + (ansible_virtualization_type == "lxc" or ansible_virtualization_type == "docker") + ) +%} +SystemCallFilter=@system-service @privileged @resources +{% endif %} +SystemCallFilter=~@clock @cpu-emulation @debug @mount @obsolete @privileged @raw-io @reboot @resources @swap @module +SystemCallArchitectures=native +# When system call is disallowed, return error code instead of killing process +SystemCallErrorNumber=EPERM + +{% if elasticsearch_exporter_cgroups_restriction_enable is defined and elasticsearch_exporter_cgroups_restriction_enable|bool %} +CPUWeight={{ elasticsearch_exporter_cgroups_cpushares | default('80') }} +CPUQuota={{ elasticsearch_exporter_cgroups_cpuquota | default('40%') }} +MemoryMax={{ elasticsearch_exporter_cgroups_memorylimit | default('2G') }} +IOWeight={{ elasticsearch_exporter_cgroups_ioweight | default('80') }} +{% endif %} + +[Install] +WantedBy=multi-user.target diff --git a/roles/elasticsearch_exporter/test-requirements.txt b/roles/elasticsearch_exporter/test-requirements.txt new file mode 100644 index 000000000..7f0b6e759 --- /dev/null +++ b/roles/elasticsearch_exporter/test-requirements.txt @@ -0,0 +1 @@ +bcrypt diff --git a/roles/elasticsearch_exporter/vars/main.yml b/roles/elasticsearch_exporter/vars/main.yml new file mode 100644 index 000000000..33a4fd278 --- /dev/null +++ b/roles/elasticsearch_exporter/vars/main.yml @@ -0,0 +1,9 @@ +--- +_elasticsearch_exporter_go_ansible_arch: "{{ {'i386': '386', + 'x86_64': 'amd64', + 'aarch64': 'arm64', + 'armv7l': 'armv7', + 'armv6l': 'armv6'}.get(ansible_facts['architecture'], ansible_facts['architecture']) }}" +_elasticsearch_exporter_repo: "prometheus-community/elasticsearch_exporter" +_github_api_headers: "{{ {'GITHUB_TOKEN': lookup('ansible.builtin.env', 'GITHUB_TOKEN')} if (lookup('ansible.builtin.env', 'GITHUB_TOKEN')) else {} }}" +_elasticsearch_exporter_binaries: ['elasticsearch_exporter'] diff --git a/roles/fail2ban_exporter/defaults/main.yml b/roles/fail2ban_exporter/defaults/main.yml index 4a4ed79e3..4fc901010 100644 --- a/roles/fail2ban_exporter/defaults/main.yml +++ b/roles/fail2ban_exporter/defaults/main.yml @@ -1,5 +1,5 @@ --- -fail2ban_exporter_version: 0.10.2 +fail2ban_exporter_version: 0.10.3 fail2ban_exporter_binary_url: "https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/releases/v{{ fail2ban_exporter_version }}/downloads/\ fail2ban_exporter_{{ fail2ban_exporter_version }}_{{ ansible_facts['system'] | lower }}_{{ _fail2ban_exporter_go_ansible_arch }}.tar.gz" fail2ban_exporter_checksums_url: "https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/releases/v{{ fail2ban_exporter_version }}/downloads/\ diff --git a/roles/fail2ban_exporter/meta/argument_specs.yml b/roles/fail2ban_exporter/meta/argument_specs.yml index c7e5acbd1..f1f99f0c3 100644 --- a/roles/fail2ban_exporter/meta/argument_specs.yml +++ b/roles/fail2ban_exporter/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: fail2ban_exporter_version: description: "fail2ban_exporter package version. Also accepts latest as parameter." - default: "0.10.2" + default: "0.10.3" fail2ban_exporter_binary_url: description: "URL of the fail2ban_exporter binaries .tar.gz file" default: "https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/releases/v{{ fail2ban_exporter_version }}/downloads/fail2ban_exporter_{{ fail2ban_exporter_version }}_{{ ansible_facts['system'] | lower }}_{{ _fail2ban_exporter_go_ansible_arch }}.tar.gz" diff --git a/roles/memcached_exporter/defaults/main.yml b/roles/memcached_exporter/defaults/main.yml index b2e48e756..cf28c73ec 100644 --- a/roles/memcached_exporter/defaults/main.yml +++ b/roles/memcached_exporter/defaults/main.yml @@ -1,5 +1,5 @@ --- -memcached_exporter_version: 0.15.0 +memcached_exporter_version: 0.15.2 memcached_exporter_binary_url: "https://github.com/{{ _memcached_exporter_repo }}/releases/download/v{{ memcached_exporter_version }}/\ memcached_exporter-{{ memcached_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _memcached_exporter_go_ansible_arch }}.tar.gz" memcached_exporter_checksums_url: "https://github.com/{{ _memcached_exporter_repo }}/releases/download/v{{ memcached_exporter_version }}/sha256sums.txt" diff --git a/roles/memcached_exporter/meta/argument_specs.yml b/roles/memcached_exporter/meta/argument_specs.yml index b1b1e3fa2..f8ceed009 100644 --- a/roles/memcached_exporter/meta/argument_specs.yml +++ b/roles/memcached_exporter/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: memcached_exporter_version: description: "memcached_exporter package version. Also accepts latest as parameter." - default: "0.15.0" + default: "0.15.2" memcached_exporter_binary_url: description: "URL of the memcached_exporter binaries .tar.gz file" default: "https://github.com/{{ _memcached_exporter_repo }}/releases/download/v{{ memcached_exporter_version }}/memcached_exporter-{{ memcached_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _memcached_exporter_go_ansible_arch }}.tar.gz" diff --git a/roles/mongodb_exporter/defaults/main.yml b/roles/mongodb_exporter/defaults/main.yml index 7f793533f..707a728d5 100644 --- a/roles/mongodb_exporter/defaults/main.yml +++ b/roles/mongodb_exporter/defaults/main.yml @@ -1,5 +1,5 @@ --- -mongodb_exporter_version: 0.43.1 +mongodb_exporter_version: 0.44.0 mongodb_exporter_binary_url: "https://github.com/{{ _mongodb_exporter_repo }}/releases/download/v{{ mongodb_exporter_version }}/\ mongodb_exporter-{{ mongodb_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _mongodb_exporter_go_ansible_arch }}.tar.gz" mongodb_exporter_checksums_url: "https://github.com/{{ _mongodb_exporter_repo }}/releases/download/v{{ mongodb_exporter_version }}/\ diff --git a/roles/mongodb_exporter/meta/argument_specs.yml b/roles/mongodb_exporter/meta/argument_specs.yml index 89c1f05f6..6b07255c5 100644 --- a/roles/mongodb_exporter/meta/argument_specs.yml +++ b/roles/mongodb_exporter/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: mongodb_exporter_version: description: "mongodb_exporter package version. Also accepts latest as parameter." - default: "0.43.1" + default: "0.44.0" mongodb_exporter_binary_url: description: "URL of the mongodb_exporter binaries .tar.gz file" default: "https://github.com/{{ _mongodb_exporter_repo }}/releases/download/v{{ mongodb_exporter_version }}/mongodb_exporter-{{ mongodb_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _mongodb_exporter_go_ansible_arch }}.tar.gz" diff --git a/roles/nginx_exporter/defaults/main.yml b/roles/nginx_exporter/defaults/main.yml index c787c1bab..105917a3a 100644 --- a/roles/nginx_exporter/defaults/main.yml +++ b/roles/nginx_exporter/defaults/main.yml @@ -1,5 +1,5 @@ --- -nginx_exporter_version: 1.4.0 +nginx_exporter_version: 1.4.1 nginx_exporter_binary_url: "https://github.com/{{ _nginx_exporter_repo }}/releases/download/v{{ nginx_exporter_version }}/\ nginx-prometheus-exporter_{{ nginx_exporter_version }}_{{ ansible_facts['system'] | lower }}_{{ _nginx_exporter_go_ansible_arch }}.tar.gz" nginx_exporter_checksums_url: "https://github.com/{{ _nginx_exporter_repo }}/releases/download/v{{ nginx_exporter_version }}/\ diff --git a/roles/nginx_exporter/meta/argument_specs.yml b/roles/nginx_exporter/meta/argument_specs.yml index fde358aa3..d3c23a07d 100644 --- a/roles/nginx_exporter/meta/argument_specs.yml +++ b/roles/nginx_exporter/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: nginx_exporter_version: description: "nginx_exporter package version. Also accepts latest as parameter." - default: "1.4.0" + default: "1.4.1" nginx_exporter_plus: description: "Start the exporter for NGINX Plus." type: bool diff --git a/roles/node_exporter/defaults/main.yml b/roles/node_exporter/defaults/main.yml index 7ed45b0cf..c93d0b922 100644 --- a/roles/node_exporter/defaults/main.yml +++ b/roles/node_exporter/defaults/main.yml @@ -1,5 +1,5 @@ --- -node_exporter_version: 1.9.0 +node_exporter_version: 1.9.1 node_exporter_binary_url: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/\ node_exporter-{{ node_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _node_exporter_go_ansible_arch }}.tar.gz" node_exporter_checksums_url: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/sha256sums.txt" diff --git a/roles/node_exporter/meta/argument_specs.yml b/roles/node_exporter/meta/argument_specs.yml index 6b421fbb9..42faf8c4f 100644 --- a/roles/node_exporter/meta/argument_specs.yml +++ b/roles/node_exporter/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: node_exporter_version: description: "Node exporter package version. Also accepts latest as parameter." - default: "1.9.0" + default: "1.9.1" node_exporter_binary_url: description: "URL of the node exporter binaries .tar.gz file" default: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/node_exporter-{{ node_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _node_exporter_go_ansible_arch }}.tar.gz" diff --git a/roles/prometheus/defaults/main.yml b/roles/prometheus/defaults/main.yml index 20cecb4f9..28b4ecc0d 100644 --- a/roles/prometheus/defaults/main.yml +++ b/roles/prometheus/defaults/main.yml @@ -1,5 +1,5 @@ --- -prometheus_version: 3.2.1 +prometheus_version: 3.3.0 prometheus_binary_url: "https://github.com/{{ _prometheus_repo }}/releases/download/v{{ prometheus_version }}/\ prometheus-{{ prometheus_version }}.{{ ansible_facts['system'] | lower }}-{{ _prometheus_go_ansible_arch }}.tar.gz" prometheus_checksums_url: "https://github.com/{{ _prometheus_repo }}/releases/download/v{{ prometheus_version }}/sha256sums.txt" diff --git a/roles/prometheus/meta/argument_specs.yml b/roles/prometheus/meta/argument_specs.yml index a26263ff0..d627566ed 100644 --- a/roles/prometheus/meta/argument_specs.yml +++ b/roles/prometheus/meta/argument_specs.yml @@ -12,7 +12,7 @@ argument_specs: description: - "Prometheus package version. Also accepts C(latest) as parameter." - "Prometheus >= 2.x is supported" - default: "3.2.1" + default: "3.3.0" prometheus_binary_url: description: "URL of the prometheus binaries .tar.gz file" default: "https://github.com/{{ _prometheus_repo }}/releases/download/v{{ prometheus_version }}/prometheus-{{ prometheus_version }}.{{ ansible_facts['system'] | lower }}-{{ _prometheus_go_ansible_arch }}.tar.gz" diff --git a/roles/pushgateway/defaults/main.yml b/roles/pushgateway/defaults/main.yml index b8941ab9a..ff8e674c4 100644 --- a/roles/pushgateway/defaults/main.yml +++ b/roles/pushgateway/defaults/main.yml @@ -1,5 +1,5 @@ --- -pushgateway_version: 1.11.0 +pushgateway_version: 1.11.1 pushgateway_binary_url: "https://github.com/{{ _pushgateway_repo }}/releases/download/v{{ pushgateway_version }}/\ pushgateway-{{ pushgateway_version }}.{{ ansible_facts['system'] | lower }}-{{ _pushgateway_go_ansible_arch }}.tar.gz" pushgateway_checksums_url: "https://github.com/{{ _pushgateway_repo }}/releases/download/v{{ pushgateway_version }}/sha256sums.txt" diff --git a/roles/pushgateway/meta/argument_specs.yml b/roles/pushgateway/meta/argument_specs.yml index f91e9014d..335a343d0 100644 --- a/roles/pushgateway/meta/argument_specs.yml +++ b/roles/pushgateway/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: pushgateway_version: description: "Pushgateway package version. Also accepts latest as parameter." - default: "1.11.0" + default: "1.11.1" pushgateway_binary_url: description: "URL of the Pushgateway binaries .tar.gz file" default: "https://github.com/{{ _pushgateway_repo }}/releases/download/v{{ pushgateway_version }}/pushgateway-{{ pushgateway_version }}.{{ ansible_facts['system'] | lower }}-{{ _pushgateway_go_ansible_arch }}.tar.gz" @@ -25,13 +25,13 @@ argument_specs: default: "/metrics" pushgateway_web_external_url: description: > - External address on which pushgateway is available. - Useful when behind reverse proxy, e.g.: https://example.org/pushgateway + External address on which pushgateway is available. Useful when behind reverse proxy, e.g.: https://example.org/pushgateway + default: "" pushgateway_config_flags_extra: description: > - Optional extra flags to be passed to pushgateway binary, e.g. - ['--log.level=debug', '--log.format=json', '--web.enable-admin-api'] + Optional extra flags to be passed to pushgateway binary, e.g. ['--log.level=debug', '--log.format=json', '--web.enable-admin-api'] + default: [] pushgateway_tls_server_config: description: diff --git a/roles/redis_exporter/defaults/main.yml b/roles/redis_exporter/defaults/main.yml index 6e725a1a5..28c8e22ec 100644 --- a/roles/redis_exporter/defaults/main.yml +++ b/roles/redis_exporter/defaults/main.yml @@ -1,5 +1,5 @@ --- -redis_exporter_version: 1.67.0 +redis_exporter_version: 1.70.0 redis_exporter_binary_url: "https://github.com/{{ _redis_exporter_repo }}/releases/download/v{{ redis_exporter_version }}/\ redis_exporter-v{{ redis_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _redis_exporter_go_ansible_arch }}.tar.gz" redis_exporter_checksums_url: "https://github.com/{{ _redis_exporter_repo }}/releases/download/v{{ redis_exporter_version }}/sha256sums.txt" diff --git a/roles/redis_exporter/meta/argument_specs.yml b/roles/redis_exporter/meta/argument_specs.yml index 81eaa84dd..90ce8ccc7 100644 --- a/roles/redis_exporter/meta/argument_specs.yml +++ b/roles/redis_exporter/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: redis_exporter_version: description: "redis_exporter package version. Also accepts latest as parameter." - default: "1.67.0" + default: "1.70.0" redis_exporter_binary_url: description: "URL of the redis_exporter binaries .tar.gz file" default: "https://github.com/{{ _redis_exporter_repo }}/releases/download/v{{ redis_exporter_version }}/redis_exporter-v{{ redis_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _redis_exporter_go_ansible_arch }}.tar.gz" diff --git a/roles/smokeping_prober/defaults/main.yml b/roles/smokeping_prober/defaults/main.yml index 7bfd04860..7219bad40 100644 --- a/roles/smokeping_prober/defaults/main.yml +++ b/roles/smokeping_prober/defaults/main.yml @@ -1,5 +1,5 @@ --- -smokeping_prober_version: 0.9.0 +smokeping_prober_version: 0.10.0 smokeping_prober_binary_url: "https://github.com/{{ _smokeping_prober_repo }}/releases/download/v{{ smokeping_prober_version }}/\ smokeping_prober-{{ smokeping_prober_version }}.{{ ansible_facts['system'] | lower }}-{{ _smokeping_prober_go_ansible_arch }}.tar.gz" smokeping_prober_checksums_url: "https://github.com/{{ _smokeping_prober_repo }}/releases/download/v{{ smokeping_prober_version }}/sha256sums.txt" diff --git a/roles/smokeping_prober/meta/argument_specs.yml b/roles/smokeping_prober/meta/argument_specs.yml index caf7ae0f3..4d82b15cb 100644 --- a/roles/smokeping_prober/meta/argument_specs.yml +++ b/roles/smokeping_prober/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: smokeping_prober_version: description: "Smokeping Prober package version. Also accepts latest as parameter." - default: "0.9.0" + default: "0.10.0" smokeping_prober_binary_url: description: "URL of the Smokeping Prober binaries .tar.gz file" default: "https://github.com/{{ _smokeping_prober_repo }}/releases/download/v{{ smokeping_prober_version }}/smokeping_prober-{{ smokeping_prober_version }}.{{ ansible_facts['system'] | lower }}-{{ _smokeping_prober_go_ansible_arch }}.tar.gz" diff --git a/roles/systemd_exporter/defaults/main.yml b/roles/systemd_exporter/defaults/main.yml index 51482389d..d3cdc9017 100644 --- a/roles/systemd_exporter/defaults/main.yml +++ b/roles/systemd_exporter/defaults/main.yml @@ -1,5 +1,5 @@ --- -systemd_exporter_version: 0.6.0 +systemd_exporter_version: 0.7.0 systemd_exporter_binary_url: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/\ systemd_exporter-{{ systemd_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _systemd_exporter_go_ansible_arch }}.tar.gz" systemd_exporter_checksums_url: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/sha256sums.txt" diff --git a/roles/systemd_exporter/meta/argument_specs.yml b/roles/systemd_exporter/meta/argument_specs.yml index 3fa2aeedf..400903bf3 100644 --- a/roles/systemd_exporter/meta/argument_specs.yml +++ b/roles/systemd_exporter/meta/argument_specs.yml @@ -10,7 +10,7 @@ argument_specs: options: systemd_exporter_version: description: "SystemD exporter package version. Also accepts latest as parameter." - default: "0.6.0" + default: "0.7.0" systemd_exporter_binary_url: description: URL of the systemd exporter binaries .tar.gz file" default: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/systemd_exporter-{{ systemd_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _systemd_exporter_go_ansible_arch }}.tar.gz" diff --git a/tests/integration/targets/molecule-elasticsearch_exporter-alternative/runme.sh b/tests/integration/targets/molecule-elasticsearch_exporter-alternative/runme.sh new file mode 100755 index 000000000..d094c3e1b --- /dev/null +++ b/tests/integration/targets/molecule-elasticsearch_exporter-alternative/runme.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +collection_root=$(pwd | grep -oP ".+\/ansible_collections\/\w+?\/\w+") +source "$collection_root/tests/integration/molecule.sh" diff --git a/tests/integration/targets/molecule-elasticsearch_exporter-default/runme.sh b/tests/integration/targets/molecule-elasticsearch_exporter-default/runme.sh new file mode 100755 index 000000000..d094c3e1b --- /dev/null +++ b/tests/integration/targets/molecule-elasticsearch_exporter-default/runme.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +collection_root=$(pwd | grep -oP ".+\/ansible_collections\/\w+?\/\w+") +source "$collection_root/tests/integration/molecule.sh" diff --git a/tests/integration/targets/molecule-elasticsearch_exporter-latest/runme.sh b/tests/integration/targets/molecule-elasticsearch_exporter-latest/runme.sh new file mode 100755 index 000000000..d094c3e1b --- /dev/null +++ b/tests/integration/targets/molecule-elasticsearch_exporter-latest/runme.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +collection_root=$(pwd | grep -oP ".+\/ansible_collections\/\w+?\/\w+") +source "$collection_root/tests/integration/molecule.sh"