Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Noble #29

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ jobs:
fail-fast: false
matrix:
include:
- distro: debian8
- distro: debian9
- distro: debian10
- distro: ubuntu1604
ansible-version: '>=2.10, <2.11'
- distro: ubuntu1604
ansible-version: '>=9, <10'
- distro: debian11
- distro: debian12
- distro: ubuntu1804
ansible-version: '>=9, <10'
- distro: ubuntu2004
- distro: ubuntu2204
- distro: ubuntu2404

steps:
- name: Check out the codebase
Expand All @@ -65,8 +66,8 @@ jobs:
python-version: '3.x'

- name: Install test dependencies
run: pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker

run: |
pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker
- name: Run Molecule tests
run: |
molecule test
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ on **Ubuntu** this package is in **multiverse**. See the *"Recommended"* section
* `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_load` [optional]: Unacceptable `1`, `5` and `15`-minute load averages (e.g. `12 10 5`)

* `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

Expand Down
39 changes: 23 additions & 16 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
role = File.basename(File.expand_path(File.dirname(__FILE__)))

boxes = [
{
:name => "ubuntu-1604",
:box => "bento/ubuntu-16.04",
:ip => '10.0.0.12',
:cpu => "50",
:ram => "256"
},
{
:name => "ubuntu-1804",
:box => "bento/ubuntu-18.04",
Expand All @@ -23,21 +16,21 @@ boxes = [
:box => "bento/ubuntu-20.04",
:ip => '10.0.0.14',
:cpu => "50",
:ram => "384"
:ram => "512"
},
{
:name => "debian-8",
:box => "bento/debian-8",
:ip => '10.0.0.16',
:name => "ubuntu-2204",
:box => "bento/ubuntu-22.04",
:ip => '10.0.0.15',
:cpu => "50",
:ram => "256"
:ram => "512"
},
{
:name => "debian-9",
:box => "bento/debian-9",
:ip => '10.0.0.17',
:name => "ubuntu-2404",
:box => "bento/ubuntu-24.04",
:ip => '10.0.0.16',
:cpu => "50",
:ram => "256"
:ram => "512"
},
{
:name => "debian-10",
Expand All @@ -46,6 +39,20 @@ boxes = [
:cpu => "50",
:ram => "256"
},
{
:name => "debian-11",
:box => "bento/debian-11",
:ip => '10.0.0.19',
:cpu => "50",
:ram => "256"
},
{
:name => "debian-12",
:box => "bento/debian-12",
:ip => '10.0.0.20',
:cpu => "50",
:ram => "384"
},
]

Vagrant.configure("2") do |config|
Expand Down
10 changes: 5 additions & 5 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# meta file
---
galaxy_info:
namespace: oefenweb
author: oefenweb
role_name: snmpd
author: Mischa ter Smitten
company: Oefenweb.nl B.V.
description: Set up snmp(d) in Debian-like systems
license: MIT
min_ansible_version: 2.10.0
platforms:
- name: Ubuntu
versions:
- xenial
- bionic
- focal
- jammy
- noble
- name: Debian
versions:
- jessie
- stretch
- buster
- bullseye
- bookworm
galaxy_tags:
- system
dependencies: []
6 changes: 1 addition & 5 deletions molecule/default/collections.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
---
collections:
- name: community.docker
version: '>=1.2.0,<2'
- name: community.general
version: '>=2,<3'
collections: []
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu1604}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
- name: Prepare
hosts: all
become: true
pre_tasks:
tasks:
- name: include vars

Check warning on line 6 in molecule/default/prepare.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml"
- name: include tasks

Check warning on line 8 in molecule/default/prepare.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.import_tasks: "{{ playbook_dir }}/../../tests/tasks/pre.yml"
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tasks file
---
- name: install dependencies

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.apt:
name: "{{ snmpd_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
Expand All @@ -11,7 +11,7 @@
- snmpd
- snmpd-dependencies

- name: install

Check warning on line 14 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.apt:
name: "{{ snmpd_install }}"
state: "{{ apt_install_state | default('latest') }}"
Expand All @@ -20,33 +20,33 @@
- snmpd
- snmpd-install

- name: update configuration file - /etc/default/snmpd.conf

Check warning on line 23 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.template:
src: etc/default/snmpd.j2
dest: /etc/default/snmpd
owner: root
group: root
mode: 0644
mode: '0644'
notify: restart snmpd
tags:
- configuration
- snmpd
- snmpd-configuration

- name: update configuration file - /etc/snmp/snmpd.conf

Check warning on line 36 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.template:
src: etc/snmp/snmpd.conf.j2
dest: /etc/snmp/snmpd.conf
owner: root
group: root
mode: 0600
mode: '0600'
notify: restart snmpd
tags:
- configuration
- snmpd
- snmpd-configuration

- name: start and enable service

Check warning on line 49 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.service:
name: snmpd
state: "{{ service_default_state | default('started') }}"
Expand Down
3 changes: 3 additions & 0 deletions templates/etc/snmp/snmpd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ includeAllDisks {{ snmpd_disks_include_all_threshold_minpercent }}
{% for snmpd_disk in snmpd_disks %}
disk {{ snmpd_disk.path }} {{ snmpd_disk.threshold }}
{% endfor %}
{% if snmpd_load is defined %}
load {{ snmpd_load }}
{% endif %}

defaultMonitors {{ 'yes' if snmpd_default_monitors else 'no' }}
linkUpDownNotifications {{ 'yes' if snmpd_link_up_down_notifications else 'no' }}
Expand Down
3 changes: 2 additions & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# tests file for snmpd
---
- hosts: localhost
- name: converge
hosts: localhost
connection: local
become: true
pre_tasks:
Expand Down
3 changes: 2 additions & 1 deletion tests/vagrant.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# test file
---
- hosts: all
- name: converge
hosts: all
remote_user: vagrant
become: true
pre_tasks:
Expand Down
Loading