From 45f51b67b137f4dd36ba1850f17060088e4164d9 Mon Sep 17 00:00:00 2001 From: Elveg Date: Fri, 17 Jul 2026 12:24:02 +0300 Subject: [PATCH] add tests for ubuntu + task: apt update --- roles/grafana_alloy/molecule/default/molecule.yml | 9 +++++++++ roles/grafana_alloy/tasks/install.yml | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/roles/grafana_alloy/molecule/default/molecule.yml b/roles/grafana_alloy/molecule/default/molecule.yml index 8fce403..1bc4d0a 100644 --- a/roles/grafana_alloy/molecule/default/molecule.yml +++ b/roles/grafana_alloy/molecule/default/molecule.yml @@ -14,6 +14,15 @@ platforms: - /sys/fs/cgroup:/sys/fs/cgroup:rw cgroupns_mode: host privileged: true + + - name: ubuntu + image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2404}-ansible:latest + pre_build_image: true + command: ${MOLECULE_DOCKER_COMMAND:-""} + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + cgroupns_mode: host + privileged: true provisioner: name: ansible diff --git a/roles/grafana_alloy/tasks/install.yml b/roles/grafana_alloy/tasks/install.yml index d95fe6f..e52ae0d 100644 --- a/roles/grafana_alloy/tasks/install.yml +++ b/roles/grafana_alloy/tasks/install.yml @@ -37,6 +37,11 @@ fail_msg: "alloy version {{ grafana_alloy_version }} is not installed or not working correctly" rescue: + - name: "Install | Update apt cache on Debian" + ansible.builtin.apt: + update_cache: true + when: ansible_facts["os_family"] == "Debian" + - name: "Install | Ensure unzip is present" ansible.builtin.package: name: "unzip"