<commit_before>
williamyeh.prometheus for Ansible Galaxy
============

[![Circle CI](https://circleci.com/gh/William-Yeh/ansible-prometheus.svg?style=shield)](https://circleci.com/gh/William-Yeh/ansible-prometheus) [![Build Status](https://travis-ci.org/William-Yeh/ansible-prometheus.svg?branch=master)](https://travis-ci.org/William-Yeh/ansible-prometheus)



## Summary

Role name in Ansible Galaxy: **[williamyeh.prometheus](https://galaxy.ansible.com/list#/roles/4357)**

This Ansible role has the following features for [Prometheus](http://prometheus.io/):

 - Install specific versions of Prometheus server, node_exporter, and alertmanager.
 - Handlers for restart/reload/stop events;
 - Bare bone configuration (*real* configuration should be left to user's template files; see **Usage** section below).




## Role Variables

### Mandatory variables

None.



### Optional variables: genaral settings


User-configurable defaults:

```yaml
# user and group
prometheus_user:   prometheus
prometheus_group:  prometheus


# which components to install?
# possible values:
#  - "prometheus"
#  - "node_exporter"
#  - "alertmanager"
prometheus_components: [ "prometheus", "node_exporter" ]


# directory for executable files
prometheus_install_path:   /opt/prometheus

# directory for configuration files
prometheus_config_path:    /etc/prometheus

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

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



# directory for temporary files
prometheus_download_path:  /tmp


# version of helper utility "gosu"
gosu_version:  1.4
```



### Optional variables: Prometheus server

User-configurable defaults:

```yaml
# which version?
prometheus_version:  0.15.1



# directory for rule files
prometheus_rule_path:  {{ prometheus_config_path }}/rules

# directory for file_sd files
prometheus_file_sd_config_path:  {{ prometheus_config_path }}/tgroups

# directory for runtime database
prometheus_db_path:   /var/lib/prometheus
```






User-installable configuration file (see [doc](http://prometheus.io/docs/operating/configuration/) for details):


```yaml
# main conf template relative to `playbook_dir`;
# to be installed to "{{ prometheus_config_path }}/prometheus.yml"
prometheus_conf_main
```


User-installable rule files (see [doc](http://prometheus.io/docs/alerting/rules/) for details):


```yaml
# rule files to be installed to "{{ prometheus_rule_path }}" directory;
# dict fields:
#   - key: memo for this rule
#   - value:
#     - src:  file relative to `playbook_dir`
#     - dest: target file relative to `{{ prometheus_rule_path }}`
prometheus_rule_files
```


Alertmanager to be triggered:

```yaml
prometheus_alertmanager_url
```


### Optional variables: Node exporter


User-configurable defaults:

```yaml
# which version?
prometheus_node_exporter_version:  0.11.0
```



### Optional variables: Alertmanager


User-configurable defaults:

```yaml
# which version?
prometheus_alertmanager_version:  0.0.3

# directory for runtime database
prometheus_alertmanager_db_path: /var/lib/alertmanager
```



User-installable alertmanager conf file (see [doc](http://prometheus.io/docs/alerting/alertmanager/) for details):


```yaml
# main conf template relative to `playbook_dir`;
# to be installed to "{{ prometheus_config_path }}/alertmanager.conf"
prometheus_alertmanager_conf

```


## Handlers

Prometheus server:

- `restart prometheus`

- `reload prometheus`<commit_msg>Update: default version of alertmanager: 0.0.4<commit_after>
williamyeh.prometheus for Ansible Galaxy
============

[![Circle CI](https://circleci.com/gh/William-Yeh/ansible-prometheus.svg?style=shield)](https://circleci.com/gh/William-Yeh/ansible-prometheus) [![Build Status](https://travis-ci.org/William-Yeh/ansible-prometheus.svg?branch=master)](https://travis-ci.org/William-Yeh/ansible-prometheus)



## Summary

Role name in Ansible Galaxy: **[williamyeh.prometheus](https://galaxy.ansible.com/list#/roles/4357)**

This Ansible role has the following features for [Prometheus](http://prometheus.io/):

 - Install specific versions of Prometheus server, node_exporter, and alertmanager.
 - Handlers for restart/reload/stop events;
 - Bare bone configuration (*real* configuration should be left to user's template files; see **Usage** section below).




## Role Variables

### Mandatory variables

None.



### Optional variables: genaral settings


User-configurable defaults:

```yaml
# user and group
prometheus_user:   prometheus
prometheus_group:  prometheus


# which components to install?
# possible values:
#  - "prometheus"
#  - "node_exporter"
#  - "alertmanager"
prometheus_components: [ "prometheus", "node_exporter" ]


# directory for executable files
prometheus_install_path:   /opt/prometheus

# directory for configuration files
prometheus_config_path:    /etc/prometheus

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

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



# directory for temporary files
prometheus_download_path:  /tmp


# version of helper utility "gosu"
gosu_version:  1.4
```



### Optional variables: Prometheus server

User-configurable defaults:

```yaml
# which version?
prometheus_version:  0.15.1



# directory for rule files
prometheus_rule_path:  {{ prometheus_config_path }}/rules

# directory for file_sd files
prometheus_file_sd_config_path:  {{ prometheus_config_path }}/tgroups

# directory for runtime database
prometheus_db_path:   /var/lib/prometheus
```






User-installable configuration file (see [doc](http://prometheus.io/docs/operating/configuration/) for details):


```yaml
# main conf template relative to `playbook_dir`;
# to be installed to "{{ prometheus_config_path }}/prometheus.yml"
prometheus_conf_main
```


User-installable rule files (see [doc](http://prometheus.io/docs/alerting/rules/) for details):


```yaml
# rule files to be installed to "{{ prometheus_rule_path }}" directory;
# dict fields:
#   - key: memo for this rule
#   - value:
#     - src:  file relative to `playbook_dir`
#     - dest: target file relative to `{{ prometheus_rule_path }}`
prometheus_rule_files
```


Alertmanager to be triggered:

```yaml
prometheus_alertmanager_url
```


### Optional variables: Node exporter


User-configurable defaults:

```yaml
# which version?
prometheus_node_exporter_version:  0.11.0
```



### Optional variables: Alertmanager


User-configurable defaults:

```yaml
# which version?
prometheus_alertmanager_version:  0.0.4

# directory for runtime database
prometheus_alertmanager_db_path: /var/lib/alertmanager
```



User-installable alertmanager conf file (see [doc](http://prometheus.io/docs/alerting/alertmanager/) for details):


```yaml
# main conf template relative to `playbook_dir`;
# to be installed to "{{ prometheus_config_path }}/alertmanager.conf"
prometheus_alertmanager_conf

```


## Handlers

Prometheus server:

- `restart prometheus`

- `reload prometheus`
{'fraction_non_alphanumeric': 0.11801685955136448, 'fraction_numerical': 0.005286469495642235, 'mean_word_length': 4.922165820642978, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1478006', 'n_tokens_mistral': 2380, 'n_tokens_neox': 2140, 'n_words': 546}