Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Georg Kahest committed Sep 14, 2017
2 parents f5da571 + fcaf300 commit 2a0b22d
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 35 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.2.7
56 changes: 39 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,51 @@
---
language: python
python: "2.7"
python: "2.7_with_system_site_packages"

# Use the new container infrastructure
sudo: false
sudo: required
env:
- distro: debian8
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distro: ubuntu1604
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distro: centos7
init: /usr/lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distro: ubuntu1404
- distro: centos6

# Install ansible
addons:
apt:
packages:
- python-pip
services:
- docker
before_install:
# Pull container from Docker Hub.
- 'docker pull geerlingguy/docker-${distro}-ansible:latest'

install:
# Install ansible
- pip install ansible

# Check ansible version
- ansible --version
script:
# Create a random file to store the container ID.
#- container_id=$(mktemp)

# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
# Run container detached, with our role mounted inside.
# - 'docker run --detach --volume="${PWD}":/etc/ansible/roles/ansible-observium-agent:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"'

script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
# - docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook tests/test.yml -i tests/inventory --syntax-check
# - docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook --connection=local --sudo -v --diff tests/test.yml
# - >
# docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook --connection=local --sudo tests/test.yml
# | grep -q 'changed=0.*failed=0'
# && (echo 'Idempotence test: pass' && exit 0)
# || (echo 'Idempotence test: fail' && exit 1)

# Download test shim.
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/teadur/35818c6a66aa7c36a1c91b40c0e2275e/raw/
- chmod +x ${PWD}/tests/test.sh

# Run tests.
- ${PWD}/tests/test.sh

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks: https://galaxy.ansible.com/api/v1/notifications/
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
[![Build Status](https://travis-ci.org/teadur/ansible-observium-agent.svg?branch=master)](https://travis-ci.org/teadur/ansible-observium-agent)

observium-agent
=========

This role manages observium-agent on Debian based Linux.
It configures xinetd to run obserivum-agent and deploys defined agent plugins to host.
This role manages observium-agent on Linux.
It configures install/configures xinetd to run obserivum-agent and deploys defined agent plugins to host.


Requirements
------------

Xinetd running on host ( installed by this role )

SNMP running on host ( only configuration is modified, one oid is added, must be installed by some other role)

Role Variables
--------------

observium_host: host running observium ( defaults to 127.0.0.1 )
observium_host: host running observium ( defaults to 127.0.0.1 )

obs_agent_pg_enable: boolean (default false)

obs_agent_apache_enable: boolean (default false)

obs_agent_bind_enable: boolean (default false)

All variables can be found in defaults/main.yml

Dependencies
------------

None

Example Playbook
----------------
Expand Down
18 changes: 9 additions & 9 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
galaxy_info:
author: Georg Kahest
description: Role to manage/install Observium agent on Debian
description: Role to manage/install Observium agent and plugins on Linux
company: your company (optional)
license: MIT
min_ansible_version: 2.2
Expand Down Expand Up @@ -105,8 +105,8 @@ galaxy_info:
# - 9.1
# - 9.2
# - 9.3
#- name: Ubuntu
# versions:
- name: Ubuntu
versions:
# - all
# - lucid
# - maverick
Expand All @@ -116,11 +116,11 @@ galaxy_info:
# - quantal
# - raring
# - saucy
# - trusty
- trusty
# - utopic
# - vivid
# - wily
# - xenial
- xenial
- name: Debian
versions:
# - all
Expand All @@ -131,12 +131,12 @@ galaxy_info:
# - squeeze
- stretch
- wheezy
#- name: EL
# versions:
- name: EL
versions:
# - all
# - 5
# - 6
# - 7
- 6
- 7
#- name: Windows
# versions:
# - all
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: be sure xinetd is installed
apt: pkg=xinetd state=installed
tags: xinetd
when: ansible_distribution == "Debian"
when: ansible_distribution == "Debian" or ansible_distribution == "Ubuntu"

- name: be sure xinetd is installed
yum: pkg=xinetd state=installed
Expand Down
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- hosts: localhost
remote_user: root
roles:
- observium-agent
- role_under_test

0 comments on commit 2a0b22d

Please sign in to comment.