-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
195 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
stages: | ||
- checks | ||
- test | ||
- changes | ||
- push | ||
|
||
variables: | ||
GITHUB_USER: lotusnoir | ||
|
||
|
||
################################################## | ||
# SYNTAX CHECKS | ||
################################################## | ||
yamllint: | ||
stage: checks | ||
image: sdesbure/yamllint | ||
before_script: | ||
- yamllint --version | ||
script: | ||
- yamllint . | ||
|
||
ansible-lint: | ||
stage: checks | ||
image: lotusnoir/ansible_play | ||
script: | ||
- ansible-lint . | ||
|
||
###################################################### | ||
# RUN MOLECULE FOR FULL TEST SCENARIO | ||
###################################################### | ||
molecule: | ||
stage: test | ||
image: lotusnoir/molecule_play | ||
services: | ||
- docker:dind | ||
variables: | ||
PY_COLORS: 1 | ||
needs: | ||
- yamllint | ||
- ansible-lint | ||
before_script: | ||
- molecule --version | ||
script: | ||
- molecule test | ||
|
||
###################################################### | ||
# GENERATE CHANGELOG FILE | ||
###################################################### | ||
changelog: | ||
stage: changes | ||
image: node:latest | ||
needs: | ||
- molecule | ||
artifacts: | ||
paths: | ||
- CHANGELOG.md | ||
expire_in: 1 day | ||
before_script: | ||
- npm install -g auto-changelog | ||
script: | ||
- auto-changelog -t keepachangelog --sort-commits date-desc --hide-empty-releases --hide-credit -l 10 -b 10 | ||
|
||
|
||
################################################## | ||
# PUSH CODE WHEN ALL TEST OK | ||
################################################## | ||
push_src_on_github: | ||
stage: push | ||
image: alpine:latest | ||
needs: | ||
- changelog | ||
before_script: | ||
- apk add git openssh-client | ||
- eval $(ssh-agent -s) | ||
- echo "${GITHUB_USER_PRIVATE_KEY}" | tr -d '\r' | ssh-add - | ||
- mkdir -p ~/.ssh | ||
- chmod 700 ~/.ssh | ||
- echo -e "Host *\n\tUser ansible\n\tStrictHostKeyChecking no\n\tForwardAgent yes\n\n" > ~/.ssh/config | ||
- git config --global user.email "${GITHUB_USER_EMAIL}" | ||
- git config --global user.name "${GITHUB_USER}" | ||
- git config --global init.defaultBranch main | ||
- COMMENT=$(git log -1 --pretty=%B | head -1) | ||
script: | ||
- git clone [email protected]:${GITHUB_USER}/ansible-apps_gnmic.git /tmp/ansible-apps_gnmic | ||
- rm -rf .git | ||
- cp -r . /tmp/ansible-apps_gnmic/ | ||
- cd /tmp/ansible-apps_gnmic | ||
- git add -A | ||
- git commit -m "${COMMENT}" || echo "No changes, nothing to commit!" | ||
- git push --follow-tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,36 @@ | ||
# Ansible Role: ansible-apps_gnmic | ||
# ansible-apps_gnmic | ||
|
||
## Description | ||
|
||
[![Build Status](https://travis-ci.com/lotusnoir/ansible-apps_gnmic.svg?branch=master?style=flat)](https://travis-ci.com/lotusnoir/ansible-apps_gnmic) | ||
[![License](https://img.shields.io/badge/license-Apache--2.0-brightgreen?style=flat)](https://opensource.org/licenses/Apache-2.0) | ||
[![Ansible Role](https://img.shields.io/badge/galaxy-apps_gnmic-purple?style=flat)](https://galaxy.ansible.com/lotusnoir/apps_gnmic) | ||
[![Galaxy Role](https://img.shields.io/badge/galaxy-apps_gnmic-purple?style=flat)](https://galaxy.ansible.com/lotusnoir/apps_gnmic) | ||
[![Version](https://img.shields.io/github/release/lotusnoir/ansible-apps_gnmic.svg)](https://github.com/lotusnoir/ansible-apps_gnmic/releases/latest) | ||
![GitHub repo size](https://img.shields.io/github/repo-size/lotusnoir/ansible-apps_gnmic?color=orange&style=flat) | ||
![Ansible Quality Score](https://img.shields.io/ansible/quality/52300) | ||
[![downloads](https://img.shields.io/ansible/role/d/52300)](https://galaxy.ansible.com/lotusnoir/apps_gnmic) | ||
[![Version](https://img.shields.io/github/release/lotusnoir/ansible-apps_gnmic.svg)](https://github.com/lotusnoir/ansible-apps_gnmic/releases/) | ||
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=lotusnoir_ansible-apps_gnmic&metric=alert_status)](https://sonarcloud.io/dashboard?id=lotusnoir_ansible-apps_gnmic) | ||
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=lotusnoir_ansible-apps_gnmic&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=lotusnoir_ansible-apps_gnmic) | ||
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=lotusnoir_ansible-apps_gnmic&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=lotusnoir_ansible-apps_gnmic) | ||
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=lotusnoir_ansible-apps_gnmic&metric=security_rating)](https://sonarcloud.io/dashboard?id=lotusnoir_ansible-apps_gnmic) | ||
[![downloads](https://img.shields.io/ansible/role/d/56081)](https://galaxy.ansible.com/lotusnoir/apps_gnmic) | ||
![Ansible Quality Score](https://img.shields.io/ansible/quality/56081) | ||
[![License](https://img.shields.io/badge/license-Apache--2.0-brightgreen?style=flat)](https://opensource.org/licenses/Apache-2.0) | ||
|
||
Deploy [gnmic](https://github.com/karimra/gnmic) a gnmi CLI client and collector. | ||
|
||
Deploy [gnmic](https://github.com/danielqsj/gnmic/) to expose kafka metrics to prometheus. | ||
## Requirements | ||
|
||
none | ||
|
||
## Role variables | ||
|
||
| Name | Default Value | Description | | ||
| ------------------------------ | -------------- | -----------------------------------| | ||
| `gnmic_version` | 0.13.0 | gnmic version | | ||
| `gnmic_temp_dir` | /tmp | temporary directory to uncompress package | | ||
| `gnmic_install_dir` | /usr/local/bin | directory to install binary | | ||
| `gnmic_force_install` | false | force install variable | | ||
| `gnmic_port` | 9150 | port to expose prometheus metrics | | ||
See [variables](/defaults/main.yml) for more details. | ||
|
||
## Examples | ||
|
||
--- | ||
- hosts: apps_gnmic | ||
become: yes | ||
become_method: sudo | ||
gather_facts: yes | ||
roles: | ||
- role: ansible-apps_gnmic | ||
environment: | ||
http_proxy: "{{ http_proxy }}" | ||
https_proxy: "{{ https_proxy }}" | ||
no_proxy: "{{ no_proxy }} | ||
|
||
## Prometheus rules | ||
--- | ||
- hosts: apps_gnmic | ||
become: true | ||
become_method: sudo | ||
gather_facts: true | ||
roles: | ||
- role: ansible-apps_gnmic | ||
|
||
TODO | ||
|
||
## Grafana dashboard | ||
|
||
A sample dashboard is available here: [https://grafana.com/grafana/dashboards/13572](https://grafana.com/grafana/dashboards/13572) | ||
|
||
## License | ||
|
||
This project is licensed under Apache License. See [LICENSE](/LICENSE) for more details. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,36 @@ | ||
--- | ||
galaxy_info: | ||
author: "Philippe leal" | ||
description: "Install and configure gnmic monitoring tool for prometheus" | ||
author: lotusnoir | ||
role_name: apps_gnmic | ||
license: "license: Apache License, Version 2.0" | ||
description: "Deploy [gnmic](https://github.com/karimra/gnmic) a gnmi CLI client and collector." | ||
license: "Apache License, Version 2.0" | ||
min_ansible_version: 2.8 | ||
|
||
platforms: | ||
- name: "Ubuntu" | ||
versions: | ||
- "focal" | ||
- "bionic" | ||
- "xenial" | ||
- name: "Debian" | ||
versions: | ||
- "bullseye" | ||
- "buster" | ||
- "stretch" | ||
- name: "RedHat" | ||
versions: | ||
- "Maipo" | ||
- name: "CentOS" | ||
versions: | ||
- "8" | ||
- "7" | ||
- name: "Rocky" | ||
versions: | ||
- "8" | ||
|
||
galaxy_tags: | ||
- gnmic | ||
- monitoring | ||
- network | ||
- collector | ||
- cli | ||
- prometheus | ||
- monitoring | ||
|
||
dependencies: [] |
Oops, something went wrong.