Git Product home page Git Product logo

ansible-pushgateway's Introduction

Ansible Role: pushgateway

Build Status License Ansible Role GitHub tag

Description

Deploy prometheus pushgateway using ansible.

Requirements

  • Ansible >= 2.7 (It might work on previous versions, but we cannot guarantee it)

Role Variables

All variables which can be overridden are stored in defaults/main.yml file as well as in table below.

Name Default Value Description
pushgateway_version 1.3.1 Pushgateway package version
pushgateway_web_listen_address "0.0.0.0:9091" Address on which pushgateway will listen
pushgateway_web_external_url "" External address on which pushgateway is available. Useful when behind reverse proxy. Ex. http://example.org/pushgateway
pushgateway_persistence true Enable persistence file
pushgateway_config_flags_extra {} Additional configuration flags passed at startup to pushgateway binary

Example

Playbook

Use it in a playbook as follows:

- hosts: all
  roles:
    - cloudalchemy.pushgateway

Demo site

We provide demo site for full monitoring solution based on prometheus and grafana. Repository with code and links to running instances is available on github and site is hosted on DigitalOcean.

Local Testing

The preferred way of locally testing the role is to use Docker and molecule (v3.x). You will have to install Docker on your system. See "Get started" for a Docker package suitable to for your system. Running your tests is as simple as executing molecule test.

Continuous Intergation

Combining molecule and circle CI allows us to test how new PRs will behave when used with multiple ansible versions and multiple operating systems. This also allows use to create test scenarios for different role configurations. As a result we have a quite large test matrix which can take more time than local testing, so please be patient.

Contributing

See contributor guideline.

Troubleshooting

See troubleshooting.

License

This project is licensed under MIT License. See LICENSE for more details.

ansible-pushgateway's People

Contributors

ahmadalli avatar bbichero avatar cloudalchemybot avatar nayls avatar notfloran avatar oguzhaninan avatar paulfantom avatar superq avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

ansible-pushgateway's Issues

FAILED! when skip tags ansible-pushgateway on ansible 2.9.2

The error occurs on version ansible 2.9.2, but works on 2.7.7.

Simple playbook.yaml
`---

  • hosts: all
    roles:

    • ansible-pushgateway
      tags:
    • ansible-pushgateway
  • hosts: all
    roles:

    • ansible-node-exporter
      tags:
    • ansible-node-exporter
      `

Run:
ansible-playbook -i inv --tags ansible-node-exporter playbook.yaml

Get error:
`TASK [ansible-pushgateway : Gather variables for each operating system] *******************************************************************************************************************************************
task path: /tmp/test-push-gateway/roles/ansible-pushgateway/tasks/main.yml:2
fatal: [127.0.0.1]: FAILED! => {
"msg": "No file was found when using first_found. Use errors='ignore' to allow this task to be skipped if no files are found"
}

PLAY RECAP ********************************************************************************************************************************************************************************************************
127.0.0.1 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
`

Invalid permissions of /var/lib/pushgateway/

What happened?

Persistence file is not stored

May 26 14:05:50 monitor1 pushgateway[681]: time="2020-05-26T14:05:50Z" level=error msg="Problem shutting down metric storage: open /var/lib/pushgateway/persistence.in_progress.006688094: permission denied" source="main.go:121"

How to reproduce it (as minimally and precisely as possible):

Restart pushgateway with enabled persistence

  • Role version:

0.2.2

  • Ansible version information:

2.7.18

Anything else we need to know?:

This should be simple change in configure.yml

owner: "root" -> owner: "pushgateway_system_user"

pushgateway user gid is not set to pushgateway group

What happened?

When user pushgateway is created, is not set to pushgateway group gid.

$ grep pushgateway /etc/passwd
pushgateway:x:996:100::/:/usr/sbin/nologin

Group 100 is users, not pushgateway (which is 996)

Did you expect to see some different?

I expect to see 996 gid (pushgateway)

How to reproduce it (as minimally and precisely as possible):

Install pushgateway using this role

Added fix here #49

Check-mode fails at the step "Create persistence file"

What happened?
When running in check-mode, the role fails at the step "Create persistence file"
Did you expect to see some different?
This step shouldn't fail.
How to reproduce it (as minimally and precisely as possible):
Run the role in check_mode

Environment
Fedora 31

  • Role version:
    Commit 66993dfd

  • Ansible version information:
    ansible==2.9.7

  • Variables:

pushgateway_version: 1.2.0
  • Ansible playbook execution Logs:
< TASK [ansible-pushgateway : Create persistence file] >
 ------------------------------------------------------
task path: prometheus/roles/ansible-pushgateway/tasks/configure.yml:11
fatal: [telemetrydemo]: FAILED! => 
  msg: 'The conditional check ''touch_log.diff.before.state != "file"'' failed. The error was: error while evaluating conditional (touch_log.diff.before.state != "file"): ''dict object'' has no attribute ''diff'''

Anything else we need to know?:
Thanks for the good work!

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.