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`. Easy ansible role to setup system metrics transmission to `collectd`.
Currently only `influxdb` is supported by this role. This ansible role works with 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 ## Role Variables

View file

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

View file

@ -1,6 +1,8 @@
--- ---
galaxy_info: galaxy_info:
author: Felix Niederwanger author: Felix Niederwanger
role_name: nginx
namespace: collectd
description: Configurable collectd installation role description: Configurable collectd installation role
company: SUSE company: SUSE
issue_tracker_url: https://github.com/GeekOops/geekoops-collectd/issues issue_tracker_url: https://github.com/GeekOops/geekoops-collectd/issues
@ -15,7 +17,8 @@ galaxy_info:
platforms: platforms:
- name: opensuse - name: opensuse
versions: versions:
- 15.2 - 15.3
- 15.4
galaxy_tags: galaxy_tags:
- collectd - 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: driver:
name: docker name: docker
platforms: platforms:
- name: leap15_2 - name: leap15_3
image: grisu48/leap-ansible image: registry.opensuse.org/opensuse/leap:15.3
pre_build_image: true 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: volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro - /sys/fs/cgroup:/sys/fs/cgroup:ro
capabilities:
- SYS_ADMIN
tmpfs: tmpfs:
- /run - /run
- /tmp - /tmp
@ -18,7 +28,9 @@ provisioner:
name: ansible name: ansible
inventory: inventory:
host_vars: host_vars:
leap15_2: leap15_3:
nodename: "jellyfish"
leap15_4:
nodename: "jellyfish" nodename: "jellyfish"
verifier: verifier:
name: testinfra name: testinfra

View file

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

View file

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

View file

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