Skip to content

Commit

Permalink
Fix Ansible warnings
Browse files Browse the repository at this point in the history
Add support for Ubuntu 18.04 and Debian 9
  • Loading branch information
tersmitten committed Nov 29, 2018
1 parent b338fec commit 7a9885b
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ python: "2.7"

env:
- ANSIBLE_VERSION=latest
- ANSIBLE_VERSION=2.7.2
- ANSIBLE_VERSION=2.7.1
- ANSIBLE_VERSION=2.7.0
- ANSIBLE_VERSION=2.6.8
- ANSIBLE_VERSION=2.6.7
- ANSIBLE_VERSION=2.6.6
- ANSIBLE_VERSION=2.6.5
Expand Down Expand Up @@ -60,7 +62,7 @@ script:
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- if [ "$ANSIBLE_VERSION" = "latest" ]; then ansible-lint tests/test.yml || true; fi
- if [ "$ANSIBLE_VERSION" = "latest" ]; then ansible-lint tests/test.yml; fi

notifications:
email: false
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ on **Ubuntu** this package is in **multiverse**. See the *"Recommended"* section
* `snmpd_disks_include_all`: [default: `false`]: Include all disks mounted on the system in the SNMP table
* `snmpd_disks_include_all_threshold_minpercent`: [default: `10%`]: Minimum free space specified as a percentage
* `snmpd_disks`: [default: `[]`]: List of disk paths and their corresponding thresholds to be included in the SNMP table
* `snmpd_disks.path`: [required]: The disks mountpoint (e.g. `/`)
* `snmpd_disks.threshold`: [required]: The disks minimum threshold either be specified in kB (MINSPACE) or as a percentage of the total disk (MINPERCENT% with a '%' character) (e.g. `10%`)
* `snmpd_disks.{n}.path`: [required]: The disks mountpoint (e.g. `/`)
* `snmpd_disks.{n}.threshold`: [required]: The disks minimum threshold either be specified in kB (MINSPACE) or as a percentage of the total disk (MINPERCENT% with a '%' character) (e.g. `10%`)

* `snmpd_default_monitors` [default: `true`]:
* `snmpd_link_up_down_notifications` [default: `true`]:
* `snmpd_extensions`: [default: `[]`]: List of extension names and commands
* `snmpd_default_monitors` [default: `true`]: Configure the Event `MIB` tables to monitor the various `UCD-SNMP-MIB` tables for problems
* `snmpd_link_up_down_notifications` [default: `true`]: Configure the Event `MIB` tables to monitor the `fTable` for network interfaces being taken up or down, and triggering a `linkUp` or `linkDown` notification as appropriate

* `snmpd_extensions`: [default: `[]`]: Extension MIB declaration(s)
* `snmpd_extensions.{n}.name`: [required]: An identifying string for the extension
* `snmpd_extensions.{n}.prog`: [required]: The program to run
* `snmpd_extensions.{n}.args`: [default: `[]`]: The arguments to give the program

## Dependencies

Expand Down
20 changes: 18 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

role = File.basename(File.expand_path(File.dirname(__FILE__)))


boxes = [
{
:name => "ubuntu-1204",
Expand All @@ -25,17 +26,31 @@ boxes = [
:cpu => "50",
:ram => "256"
},
{
:name => "ubuntu-1804",
:box => "bento/ubuntu-18.04",
:ip => '10.0.0.14',
:cpu => "50",
:ram => "256"
},
{
:name => "debian-7",
:box => "bento/debian-7",
:ip => '10.0.0.14',
:ip => '10.0.0.15',
:cpu => "50",
:ram => "256"
},
{
:name => "debian-8",
:box => "bento/debian-8",
:ip => '10.0.0.15',
:ip => '10.0.0.16',
:cpu => "50",
:ram => "256"
},
{
:name => "debian-9",
:box => "bento/debian-9",
:ip => '10.0.0.17',
:cpu => "50",
:ram => "256"
},
Expand All @@ -54,6 +69,7 @@ Vagrant.configure("2") do |config|

vms.vm.network :private_network, ip: box[:ip]

# TODO: Cleanup
vms.vm.provision :shell do |shell|
shell.path = "tests/vagrant.sh"
end
Expand Down
3 changes: 3 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# meta file for snmpd
---
galaxy_info:
role_name: snmpd
author: Mischa ter Smitten
company: Oefenweb.nl B.V.
description: Set up snmp(d) in Debian-like systems
Expand All @@ -12,10 +13,12 @@ galaxy_info:
- precise
- trusty
- xenial
- bionic
- name: Debian
versions:
- wheezy
- jessie
- stretch
galaxy_tags:
- system
dependencies: []
3 changes: 1 addition & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@

- name: install
apt:
name: "{{ item }}"
name: "{{ snmpd_install }}"
state: "{{ apt_install_state | default('latest') }}"
with_items: "{{ snmpd_install }}"
tags:
- configuration
- snmpd
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/snmp/snmpd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defaultMonitors {{ 'yes' if snmpd_default_monitors else 'no' }}
linkUpDownNotifications {{ 'yes' if snmpd_link_up_down_notifications else 'no' }}

{% for snmpd_extension in snmpd_extensions | default([]) %}
extend {{ snmpd_extension.name }} {{ snmpd_extension.command }}
extend {{ snmpd_extension.name }} {{ snmpd_extension.prog }} {{ snmpd_extension.args | default([]) | join(' ') }}

This comment has been minimized.

Copy link
@tersmitten

tersmitten Nov 29, 2018

Author Member

Note that I made some minor adjustments @rasschaert

{% endfor %}

master agentx
2 changes: 1 addition & 1 deletion tests/vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ thisFile="$(readlink -f ${0})";
thisFilePath="$(dirname ${thisFile})";

# Only provision once
if [ -f /provisioned ]; then
if [[ -f /provisioned ]]; then
exit 0;
fi

Expand Down

0 comments on commit 7a9885b

Please sign in to comment.