Giter Site home page Giter Site logo

idealista / prometheus_apache_exporter_role Goto Github PK

View Code? Open in Web Editor NEW
6.0 26.0 10.0 95 KB

Ansible role to install Apache Exporter for prometheus

License: Apache License 2.0

YAML 36.38% Jinja 63.62%
prometheus-exporter ansible-role ansible-galaxy

prometheus_apache_exporter_role's Introduction

Logo Build Status

Prometheus Apache Exporter Ansible role

This ansible role installs a Prometheus Apache Exporter in a debian environment. It has been tested for the following Debian versions:

  • Stretch
  • Buster
  • Bullseye

This role has been generated using the cookiecutter tool, you can generate a similar role that fits your needs using the this cookiecutter template.

Getting Started

These instructions will get you a copy of the role for your ansible playbook. Once launched, it will install an Prometheus Apache Exporter server in a Debian system.

Prerequisities

Ansible 5.2.0 version installed.

Molecule 3.5.x version installed.

For testing purposes, Molecule with Docker as driver and Goss as verifier.

Installing

Create or add to your roles dependency file (e.g requirements.yml):

- src: idealista.prometheus_apache_exporter_role
  version: 2.1.0
  name: apache_exporter

Install the role with ansible-galaxy command:

ansible-galaxy install -p roles -r requirements.yml -f

Use in a playbook:

---
- hosts: someserver
  roles:
    - role: apache_exporter

Usage

Look to the defaults properties file to see the possible configuration properties. To work properly apache module mod_status should be enabled and configure.

Testing

Install dependencies

$ pipenv sync

For more information read the pipenv docs.

Testing

$ pipenv run molecule test 

Note: if you want to add colorized output (as previous versions of molecule), you must set these environment variables:


## Built With

![Ansible](https://img.shields.io/badge/ansible-5.2.0-green.svg)
![Molecule](https://img.shields.io/badge/molecule-3.5.2-green.svg)
![Goss](https://img.shields.io/badge/goss-0.3.16-green.svg)

## Versioning

For the versions available, see the [tags on this repository](https://github.com/idealista/prometheus_apache_exporter_role/tags).

Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGELOG.md) file.

## Authors

* **Idealista** - *Work with* - [idealista](https://github.com/idealista)

See also the list of [contributors](https://github.com/idealista/prometheus_redis_exporter-role/contributors) who participated in this project.

## License

![Apache 2.0 Licence](https://img.shields.io/hexpm/l/plug.svg)

This project is licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license - see the [LICENSE.txt](LICENSE.txt) file for details.

## Contributing

Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

prometheus_apache_exporter_role's People

Contributors

blalop avatar emepege avatar jdvr avatar jmonterrubio avatar mbenabda avatar vicsufer avatar xshadow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prometheus_apache_exporter_role's Issues

[SUPPORT] Most recent version is not in Ansible Galaxy

Hello,

The most recent version that is in Github does not appear to have been updated in ansible-galaxy. The most recent version is listed as 2.0.1, however your documentation refers to 2.1.0

ansible-galaxy install -p roles -r reqs.yml -f
Starting galaxy role install process
- downloading role 'prometheus_apache_exporter_role', owned by idealista
[WARNING]: - apache_exporter was NOT installed successfully: - the specified version (2.1.0) of apache_exporter was not found in the list of available versions ([{'id': 154925, 'url': '', 'related': {}, 'summary_fields': {}, 'created':
'2021-05-26T09:33:43.023182Z', 'modified': '2021-05-26T09:33:43.023209Z', 'name': '1.0.0', 'version': '1.0.0', 'commit_date': '2017-11-23T05:41:46-05:00', 'commit_sha': '0d1c1c429cb4e83cec0ce780bee9a1411736151b', 'download_url':
'https://github.com/idealista/prometheus_apache_exporter_role/archive/1.0.0.tar.gz', 'active': None}, {'id': 155002, 'url': '', 'related': {}, 'summary_fields': {}, 'created': '2021-05-27T14:12:12.055893Z', 'modified':
'2021-05-27T14:12:12.055919Z', 'name': '2.0.0', 'version': '2.0.0', 'commit_date': '2021-05-27T09:50:34-04:00', 'commit_sha': '4c7a3b545b011686ab20aa5bb5074b76a7b6c47a', 'download_url':
'https://github.com/idealista/prometheus_apache_exporter_role/archive/2.0.0.tar.gz', 'active': None}, {'id': 155949, 'url': '', 'related': {}, 'summary_fields': {}, 'created': '2021-06-07T08:38:30.189131Z', 'modified':
'2021-06-07T08:38:30.189177Z', 'name': '2.0.1', 'version': '2.0.1', 'commit_date': '2021-06-07T04:13:27-04:00', 'commit_sha': '4bc363651a43c7f63d5d01fad34328e6376241cf', 'download_url':
'https://github.com/idealista/prometheus_apache_exporter_role/archive/2.0.1.tar.gz', 'active': None}]).
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.

[FEATURE] Support for debian bullseye

Description

[Description of the issue]

Why is this needed?

[A clear and concise description of why do you think this is needed]

Additional Information

[Any additional information, configuration or data.]

Option to not do logrotate stuff

Description

There should be a variable for enabling or disabling the task related to logrotate. It could be named for instance apache_exporter_logrotate_enabled

Why is this needed?

This would be usefull when we configure logrotate with the logrotate role.

Additional Information

N/A

[FEATURE] Add support to setup ulimit (max file opened) in apache exporter service

Description

In order to avoid failures related with "too many open files" from a running process, we have to add support to setup systemd service in case expand this threshold would be a requirement.

Why is this needed?

Because there may be some situations where expand the ulimit is required.

Additional Information

There are some roles that have already had it, for example:

https://github.com/idealista/clickhouse_role/blob/3bda7a062f6a3ae924c21c7d21b071343da57150/templates/clickhouse-server.service.j2#L14

Error during configuring service - failed to find required executable systemctl

Prerequisites

Description

I'm running into a confusing error during the "Configuring Service" task:

fatal: [ec2-XX-XX-XX.compute-1.amazonaws.com]: FAILED! => {"changed": false, "msg": "Failed to find required executable systemctl in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}

I understand it's systemd related. What gives?

Steps to Reproduce

  1. Load the role
  2. Target the machine(s)
  3. Apply the new role

Expected behavior: The service is configured successfully

Actual behavior: Errors

Reproduces how often: Every single time

Versions

latest - exporter 0.5.0

Additional Information

Remote system is ubuntu 16.04, apache version 2.2.22

[BUG] "error while templating string: no test named 'false'" at playbook run

Description

I am upgrading from v1.0.0 of this role to v2.0.0, and am facing a templating error when applying the role on a machine.

  • the error is:
TASK [apache-exporter : APACHE_EXPORTER | Download and extract package] ************************************************************************************************************************************
task path: /.../.ansible/roles/apache-exporter/tasks/install.yml:37
fatal: [xxx.xxx.xxx.xxx]: FAILED! => {"msg": "The conditional check 'apache_exporter_is_installed is false or apache_exporter_is_different_version is true' failed. The error was: template error while templating string: no test named 'false'. String: {% if apache_exporter_is_installed is false or apache_exporter_is_different_version is true %} True {% else %} False {% endif %}\n\nThe error appears to be in '/.../.ansible/roles/apache-exporter/tasks/install.yml': line 37, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: APACHE_EXPORTER | Download and extract package\n  ^ here\n"}
  • this error shows up every time the role is run
  • no hostvars were changed
  • the host had previously been configured with v1.0.0 and has a running exporter on it

Environment

  • ansible [core 2.11.0]
  • python version = 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
  • jinja version = 2.10
  • libyaml = True

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.