Skip to content

Commit 5a2b740

Browse files
committed
Initial Commit
0 parents  commit 5a2b740

File tree

16 files changed

+294
-0
lines changed

16 files changed

+294
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.retry
2+
*/__pycache__
3+
*.pyc

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
language: python
3+
services: docker
4+
5+
env:
6+
global:
7+
- ROLE_NAME: apache_exporter
8+
matrix:
9+
- MOLECULE_DISTRO: centos7
10+
- MOLECULE_DISTRO: debian9
11+
12+
install:
13+
# Install test dependencies.
14+
- pip install molecule docker
15+
16+
before_script:
17+
# Use actual Ansible Galaxy role name for the project directory.
18+
- cd ../
19+
- mv ansible-role-$ROLE_NAME cloudweeb.$ROLE_NAME
20+
- cd cloudweeb.$ROLE_NAME
21+
22+
script:
23+
# Run tests.
24+
- molecule test
25+
26+
notifications:
27+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

.yamllint

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extends: default
2+
3+
rules:
4+
braces:
5+
max-spaces-inside: 1
6+
level: error
7+
brackets:
8+
max-spaces-inside: 1
9+
level: error
10+
line-length: disable

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Agnesius Santo Naibaho
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Ansible Role Apache Exporter
2+
=========
3+
4+
[![Build Status](https://travis-ci.com/cloudweeb/ansible-role-apache_exporter.svg?branch=master)](https://travis-ci.com/cloudweeb/ansible-role-apache_exporter)
5+
6+
Ansible role to install apache_exporter
7+
8+
Requirements
9+
------------
10+
11+
None
12+
13+
Role Variables
14+
--------------
15+
16+
| variable | default | comment |
17+
|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
18+
| apache_exporter_version | 0.5.0 | apache_exporter version |
19+
| apache_exporter_download_url | [defaults/main.yml#L8](https://github.com/cloudweeb/ansible-role-apache_exporter/blob/master/defaults/main.yml#L8) | url to download apache exporter binary |
20+
| apache_exporter_scrape_uri | [defaults/main.yml#L10](https://github.com/cloudweeb/ansible-role-apache_exporter/blob/master/defaults/main.yml#L10) | apache mod_status url |
21+
| apache_exporter_telemetry_address | 0.0.0.0:9117 | apache_exporter listen address |
22+
| apache_exporter_ignore_https | false | apache_exporter ignore https |
23+
24+
Dependencies
25+
------------
26+
27+
None
28+
29+
Example Playbook
30+
----------------
31+
32+
Including an example of how to use your role (for instance, with variables
33+
passed in as parameters) is always nice for users too:
34+
35+
- hosts: servers
36+
roles:
37+
- cloudweeb.apache_exporter
38+
39+
License
40+
-------
41+
42+
MIT / BSD
43+
44+
Author Information
45+
------------------
46+
47+
Agnesius Santo Naibaho

defaults/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
3+
apache_exporter_version: 0.5.0
4+
5+
apache_exporter_system_group: apache-exp
6+
apache_exporter_system_user: "{{ apache_exporter_system_group }}"
7+
8+
apache_exporter_download_url: >
9+
https://github.com/Lusitaniae/apache_exporter/releases/download/v{{ apache_exporter_version }}/apache_exporter-{{ apache_exporter_version }}.linux-{{ go_arch }}.tar.gz
10+
11+
apache_exporter_scrape_uri: http://localhost/server-status/?auto
12+
apache_exporter_telemetry_address: 0.0.0.0:9117
13+
apache_exporter_telemetry_endpoint: /metrics
14+
apache_exporter_ignore_https: false

handlers/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
3+
- name: restart apache_exporter
4+
systemd:
5+
name: apache_exporter
6+
state: restarted
7+
daemon_reload: true

meta/main.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
3+
galaxy_info:
4+
role_name: apache_exporter
5+
author: Agnesius Santo Naibaho
6+
description: Apache Exporter Installation Role
7+
company: Cloudweeb
8+
9+
license: MIT
10+
11+
min_ansible_version: 2.7
12+
13+
platforms:
14+
- name: EL
15+
versions:
16+
- 7
17+
- name: Debian
18+
versions:
19+
- stretch
20+
21+
galaxy_tags:
22+
- prometheus
23+
- apache
24+
- exporter
25+
26+
dependencies: []

molecule/default/molecule.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
driver:
5+
name: docker
6+
lint:
7+
name: yamllint
8+
platforms:
9+
- name: instance
10+
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
11+
command: ${MOLECULE_DOCKER_COMMAND:-""}
12+
volumes:
13+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
14+
privileged: true
15+
pre_build_image: true
16+
provisioner:
17+
name: ansible
18+
lint:
19+
name: ansible-lint
20+
playbooks:
21+
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
22+
scenario:
23+
name: default
24+
verifier:
25+
name: testinfra
26+
lint:
27+
name: flake8

molecule/default/playbook.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
roles:
5+
- role: cloudweeb.apache_exporter

0 commit comments

Comments
 (0)