robbiet480/ansible-memcache-exporter

An Ansible role that installs memcache_exporter for Prometheus, in the format for Ansible Galaxy

★ 0Forks 0ShellGitHub ↗Compare

README

robbiet480.memcache_exporter for Ansible Galaxy

Circle CI

Summary

Role name in Ansible Galaxy: robbiet480.memcache_exporter

This Ansible role has the following features for memcache_exporter (a memcache metrics exporter for Prometheus):

  • Install a pre-compiled version of memcache_exporter (I hope the maintainer of memcache_exporter will provide official binary releases).
  • Handlers for restart/reload/stop events.

Role Variables

Mandatory variables

None.

Optional variables

memcache_exporter specific user-configurable defaults:

# memcache Connection String URI
# @see http://docs.memcache.org/manual/reference/connection-string/
memcache_exporter_memcache_uri:  "localhost:11211"
memcache_exporter_port:  9106

Prometheus user-configurable defaults (of course, a subset of optional variables in robbiet480.prometheus):

# user and group
prometheus_user:   prometheus
prometheus_group:  prometheus


# directory for executable files
prometheus_install_path:   /opt/prometheus

# directory for logs
prometheus_log_path:       /var/log/prometheus

# directory for PID files
prometheus_pid_path:       /var/run/prometheus


# version of helper utility "gosu"
gosu_version:  1.4

Handlers

  • restart memcache_exporter

  • reload memcache_exporter

  • stop memcache_exporter

Usage

Step 1: add role

Add role name robbiet480.memcache_exporter to your playbook file.

Step 2: add variables

Set vars in your playbook file, if necessary.

Simple example:

---
# file: simple-playbook.yml

- hosts: all
  sudo: True
  roles:
    - robbiet480.memcache_exporter

  vars:

    memcache_exporter_memcache_uri:  "localhost:11211"

Dependencies

None.

License

MIT License. See the LICENSE file for details.

Contributors

robbiet480

Issues