Revive role

Update role to Leap 15.4 and switch molecule tests to internal
Dockerfiles instead of external test images.
This commit is contained in:
Felix Niederwanger 2022-06-27 16:38:03 +02:00
parent d766512d2d
commit 93c510fb7c
Signed by: phoenix
GPG key ID: 31860289A704FB3C
9 changed files with 54 additions and 8 deletions

View file

@ -5,7 +5,8 @@
Easy ansible role to setup system metrics transmission to `collectd`.
Currently only `influxdb` is supported by this role. This ansible role works with
- openSUSE Leap 15.2
- openSUSE Leap 15.3
- openSUSE Leap 15.4
## Role Variables

View file

@ -16,6 +16,7 @@ prometheus_port: "9103"
enable_disk: true
enable_cpu: true
enable_cpufreq: false
enable_load: true
enable_memory: true
enable_swap: true
@ -26,3 +27,6 @@ disk_disks: []
df_disks: []
smart_disk: ""
smart_use_serial: true
report_by_cpu: false
report_by_state: false

View file

@ -1,6 +1,8 @@
---
galaxy_info:
author: Felix Niederwanger
role_name: nginx
namespace: collectd
description: Configurable collectd installation role
company: SUSE
issue_tracker_url: https://github.com/GeekOops/geekoops-collectd/issues
@ -15,7 +17,8 @@ galaxy_info:
platforms:
- name: opensuse
versions:
- 15.2
- 15.3
- 15.4
galaxy_tags:
- collectd

View file

@ -0,0 +1,7 @@
FROM registry.opensuse.org/opensuse/leap:15.3
# Install systemd and development tools, clear cache
RUN zypper in -y systemd systemd-sysvinit firewalld python3 python3-firewall curl && rm -rf /var/cache/* && rm -f /etc/machine-id /var/lib/dbus/machine-id
# Start container with systemd
ENTRYPOINT ["/usr/sbin/init"]

View file

@ -0,0 +1,7 @@
FROM registry.opensuse.org/opensuse/leap:15.4
# Install systemd and development tools, clear cache
RUN zypper in -y systemd systemd-sysvinit firewalld python3 python3-firewall curl && rm -rf /var/cache/* && rm -f /etc/machine-id /var/lib/dbus/machine-id
# Start container with systemd
ENTRYPOINT ["/usr/sbin/init"]

View file

@ -4,13 +4,23 @@ dependency:
driver:
name: docker
platforms:
- name: leap15_2
image: grisu48/leap-ansible
pre_build_image: true
- name: leap15_3
image: registry.opensuse.org/opensuse/leap:15.3
dockerfile: Dockerfile.leap15_3
command: ${MOLECULE_DOCKER_COMMAND:-"/usr/sbin/init"}
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
tmpfs:
- /run
- /tmp
- name: leap15_4
image: registry.opensuse.org/opensuse/leap:15.4
dockerfile: Dockerfile.leap15_4
command: ${MOLECULE_DOCKER_COMMAND:-"/usr/sbin/init"}
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
capabilities:
- SYS_ADMIN
tmpfs:
- /run
- /tmp
@ -18,7 +28,9 @@ provisioner:
name: ansible
inventory:
host_vars:
leap15_2:
leap15_3:
nodename: "jellyfish"
leap15_4:
nodename: "jellyfish"
verifier:
name: testinfra

View file

@ -14,7 +14,11 @@ Interval {{ interval }}
LoadPlugin syslog
LoadPlugin cpu
#LoadPlugin cpufreq
{% if enable_cpufreq == true %}
LoadPlugin cpusleep
{% else %}
#LoadPlugin cpusleep
{% endif %}
{% if enable_df == true %}
LoadPlugin df
{% else %}
@ -109,8 +113,12 @@ LoadPlugin write_prometheus
{% if enable_cpu == true %}
<Plugin cpu>
{% if report_by_cpu == true %}
ReportByCpu true
{% endif %}
{% if report_by_state == true %}
ReportByState true
{% endif %}
ValuesPercentage true
ReportNumCpu false
ReportGuestState false

View file

@ -1,3 +1,5 @@
---
# openSUSE Leap 15.3 specific variables
packages: ['collectd']
collectd_service: "collectd"

View file

@ -1,3 +1,5 @@
---
# openSUSE Leap 15.4 specific variables
packages: ['collectd']
collectd_service: "collectd"