Install `xymon-client` packages for Debian based distros.

This commit is contained in:
Jeremy Gardais 2017-08-11 13:58:39 +02:00
commit 02fa5301e0
9 changed files with 159 additions and 0 deletions

29
.travis.yml Normal file
View File

@ -0,0 +1,29 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

5
CHANGELOG.md Normal file
View File

@ -0,0 +1,5 @@
## v1.0
### Features
* Install `xymon-client` packages for Debian based distros.

65
README.md Normal file
View File

@ -0,0 +1,65 @@
# Xymon
1. [Overview](#overview)
2. [Role Variables](#role-variables)
* [OS Specific Variables](#os-specific-variables)
3. [Example Playbook](#example-playbook)
4. [Configuration](#configuration)
5. [Development](#development)
6. [License](#license)
7. [Author Information](#author-information)
## Overview
Manage Xymon (client) installation and configuration.
## Role Variables
* **xymon_cli_manage**: If `xymon-client` should be managed with this role [default: `true`].
* **xymon_cli_pkg_state**: State of new `xymon-client` package(s) [default: `installed`].
### OS Specific Variables
Please see default value by Operating System file in [vars][vars directory] directory.
* **xymon_cli_pkg_list**: The list of packages to install to provide `xymon-client`.
## Example Playbook
* Use defaults vars:
``` yml
- hosts: serverXYZ
roles:
- role: ipr-cnrs.xymon
```
## Configuration
This role will:
* Install needed packages to provide `xymon-client`.
## Development
This source code comes from our [Gogs instance][xymon source] and the [Github repo][xymon github] exist just to be able to send the role to Ansible Galaxy…
But feel free to send issue/PR here :)
Thanks to this [hook][gogs to github hook], Github automatically got updates from our [Gogs instance][xymon source] :)
## License
[WTFPL][wtfpl website]
## Author Information
Jérémy Gardais
* Source: [on IPR's Gogs][xymon source]
* [IPR][ipr website] (Institut de Physique de Rennes)
[vars directory]: ./vars
[gogs to github hook]: https://stackoverflow.com/a/21998477
[xymon source]: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.xymon
[xymon github]: https://github.com/ipr-cnrs/xymon
[wtfpl website]: http://www.wtfpl.net/about/
[ipr website]: https://ipr.univ-rennes1.fr/

6
defaults/main.yml Normal file
View File

@ -0,0 +1,6 @@
---
# defaults file for ipr.ansible.xymon
# client
xymon_cli_manage: true
xymon_cli_pkg_state: 'installed'

23
meta/main.yml Normal file
View File

@ -0,0 +1,23 @@
galaxy_info:
author: "Jérémy Gardais"
description: "Manage Xymon configuration"
license: WTFPL
company: IPR
issue_tracker_url: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.xymon/issues
min_ansible_version: 2.2
platforms:
- name: Debian
versions:
- stretch
#- name: opensuse
# versions:
# - all
# - 12.1
# - 12.2
# - 12.3
# - 13.1
# - 13.2
galaxy_tags:
- system
- xymon
- monitoring

20
tasks/main.yml Normal file
View File

@ -0,0 +1,20 @@
---
# tasks file for ipr.ansible.xymon
- name: Load specific OS vars for xymon
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution|lower }}.yml"
- "{{ ansible_os_family|lower }}.yml"
# client {{{
- name: client package
package:
name: '{{ item }}'
state: '{{ xymon_cli_pkg_state }}'
with_items:
- '{{ xymon_cli_pkg_list }}'
when: xymon_cli_manage
# }}}

1
tests/inventory Normal file
View File

@ -0,0 +1 @@
localhost

5
tests/test.yml Normal file
View File

@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- ipr.ansible.xymon

5
vars/debian.yml Normal file
View File

@ -0,0 +1,5 @@
---
# vars file for Debian-based distros
xymon_cli_pkg_list:
- xymon-client
- hobbit-plugins