Skip to content

Commit

Permalink
fix: add autogenerated files
Browse files Browse the repository at this point in the history
  • Loading branch information
lotusnoir committed Dec 3, 2021
1 parent 33a7bf0 commit b284e1e
Show file tree
Hide file tree
Showing 13 changed files with 195 additions and 177 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.swp
91 changes: 91 additions & 0 deletions .gitlab-ci.yml
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
81 changes: 0 additions & 81 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -29,84 +29,3 @@ rules:
trailing-spaces: enable
truthy:
level: warning


#rules:
# braces:
# # Keeping 0 min-spaces to not error on empty collection definitions
# min-spaces-inside: 0
# # Allowing one space inside braces to improve code readability
# max-spaces-inside: 1
#
# brackets:
# # Keeping 0 min-spaces to not error on empty collection definitions
# min-spaces-inside: 0
# # Allowing one space inside braces to improve code readability
# max-spaces-inside: 1
#
# colons:
# level: warning
# max-spaces-before: 0
# # Allow to tab all vars on the same column
# max-spaces-after: -1
#
# commas:
# max-spaces-before: 0
# min-spaces-after: 1
# max-spaces-after: 1
#
# comments:
# # Disabling to allow for code comment blocks and #!/usr/bin/ansible-playbook
# require-starting-space: false
# ignore-shebangs: true
# min-spaces-from-content: 2
#
# comments-indentation: enable
#
# document-start:
# present: true
#
# empty-lines:
# max: 2
# max-start: 0
# max-end: 0
#
# empty-values:
# forbid-in-block-mappings: true
# forbid-in-flow-mappings: true
#
# hyphens:
# max-spaces-after: 1
#
# indentation:
# # Requiring 2 space indentation
# spaces: 2
# # Requiring consistent indentation within a file, either indented or not
# indent-sequences: consistent
# check-multi-line-strings: false
#
# key-duplicates: enable
#
# # Disabling due to copious amounts of long lines in the code which would
# line-length: disable
#
# new-line-at-end-of-file: enable
#
# new-lines:
# type: unix
#
# octal-values:
# forbid-implicit-octal: false
# forbid-explicit-octal: true
#
# quoted-strings:
# level: warning
# quote-type: any
# required: false
# extra-required: []
# extra-allowed: []
#
# trailing-spaces: enable
#
# # Disabling due to copious amounts of truthy warnings in the code which would
# truthy: disable
6 changes: 6 additions & 0 deletions CHANGELOG.md
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).
56 changes: 19 additions & 37 deletions README.md
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.

25 changes: 18 additions & 7 deletions meta/main.yml
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: []
Loading

0 comments on commit b284e1e

Please sign in to comment.