|
1 |
| -<p><img src="http://pngimg.com/uploads/skeleton/skeleton_PNG42642.png" alt="skeleton logo" title="graph" align="right" height="60" /></p> |
| 1 | +<p><img src="https://brand.systemd.io/assets/png/systemd-logomark.png" alt="systemd logo" title="systemd" align="right" height="60" /></p> |
2 | 2 |
|
3 |
| -# Cloud Alchemy Ansible Role Skeleton |
| 3 | +# Ansible Role: systemd exporter |
4 | 4 |
|
| 5 | +[](https://travis-ci.com/cloudalchemy/ansible-systemd-exporter) |
5 | 6 | [](https://opensource.org/licenses/MIT)
|
| 7 | +[](https://galaxy.ansible.com/cloudalchemy/systemd-exporter/) |
| 8 | +[](https://github.com/cloudalchemy/ansible-systemd-exporter/tags) |
6 | 9 |
|
7 | 10 | ## Description
|
8 | 11 |
|
9 |
| -Skeleton to create new ansible roles similar to other Cloud Alchemy roles. |
| 12 | +Deploy prometheus [systemd exporter](https://github.com/povilasv/systemd_exporter) using ansible. |
10 | 13 |
|
11 |
| -## How to use it |
| 14 | +## Requirements |
12 | 15 |
|
13 |
| -To create a new role, just follow a couple of easy steps: |
14 |
| -1. Clone this repo |
15 |
| -1. Open `create.sh` with your favorite editor |
16 |
| -1. Modify variables mentioned in that file |
17 |
| -1. Run `create.sh` |
| 16 | +- Ansible >= 2.7 (It might work on previous versions, but we cannot guarantee it) |
| 17 | +- gnu-tar on Mac deployer host (`brew install gnu-tar`) |
18 | 18 |
|
19 |
| -## Result |
| 19 | +## Role Variables |
20 | 20 |
|
21 |
| -After running `create.sh` it will convert this repo into a directory structure with everything needed to start |
22 |
| -developing new Cloud Alchemy ansible role. |
| 21 | +All variables which can be overridden are stored in [defaults/main.yml](defaults/main.yml) file as well as in table below. |
23 | 22 |
|
24 |
| -## Warnings |
| 23 | +| Name | Default Value | Description | |
| 24 | +| -------------- | ------------- | -----------------------------------| |
| 25 | +| `systemd_exporter_version` | 0.4.0 | SystemD exporter package version. Also accepts latest as parameter. | |
| 26 | +| `systemd_exporter_binary_local_dir` | "" | Allows to use local packages instead of ones distributed on github. As parameter it takes a directory where `systemd_exporter` binary is stored on host on which ansible is ran. This overrides `systemd_exporter_version` parameter | |
| 27 | +| `systemd_exporter_web_listen_address` | "0.0.0.0:9558" | Address on which systemd exporter will listen | |
25 | 28 |
|
26 |
| -- Running `create.sh` deletes `.git` directory. |
27 |
| -- README.md file is overwritten with ROLE_README.md |
| 29 | +## Example |
| 30 | + |
| 31 | +### Playbook |
| 32 | + |
| 33 | +Use it in a playbook as follows: |
| 34 | +```yaml |
| 35 | +- hosts: all |
| 36 | + roles: |
| 37 | + - cloudalchemy.systemd-exporter |
| 38 | +``` |
| 39 | +
|
| 40 | +### Demo site |
| 41 | +
|
| 42 | +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](https://github.com/cloudalchemy/demo-site) and site is hosted on [DigitalOcean](https://digitalocean.com). |
| 43 | +
|
| 44 | +## Local Testing |
| 45 | +
|
| 46 | +The preferred way of locally testing the role is to use Docker and [molecule](https://github.com/metacloud/molecule) (v2.x). You will have to install Docker on your system. See "Get started" for a Docker package suitable to for your system. |
| 47 | +We are using tox to simplify process of testing on multiple ansible versions. To install tox execute: |
| 48 | +```sh |
| 49 | +pip3 install tox |
| 50 | +``` |
| 51 | +To run tests on all ansible versions (WARNING: this can take some time) |
| 52 | +```sh |
| 53 | +tox |
| 54 | +``` |
| 55 | +To run a custom molecule command on custom environment with only default test scenario: |
| 56 | +```sh |
| 57 | +tox -e py35-ansible28 -- molecule test -s default |
| 58 | +``` |
| 59 | +For more information about molecule go to their [docs](http://molecule.readthedocs.io/en/latest/). |
| 60 | + |
| 61 | +If you would like to run tests on remote docker host just specify `DOCKER_HOST` variable before running tox tests. |
| 62 | + |
| 63 | +## Travis CI |
| 64 | + |
| 65 | +Combining molecule and travis 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 will take more time than local testing, so please be patient. |
| 66 | + |
| 67 | +## Contributing |
| 68 | + |
| 69 | +See [contributor guideline](CONTRIBUTING.md). |
| 70 | + |
| 71 | +## Troubleshooting |
| 72 | + |
| 73 | +See [troubleshooting](TROUBLESHOOTING.md). |
28 | 74 |
|
29 | 75 | ## License
|
30 | 76 |
|
|
0 commit comments