adfinis / ansible-role-icinga2_agent

This role is used to install the icinga2 agent
GNU General Public License v3.0
0 stars 9 forks source link

Install dependencies fails on debian based systems if no apt update was ever made #29

Closed Paul-Weisser closed 1 month ago

Paul-Weisser commented 8 months ago
ISSUE TYPE
ANSIBLE VERSION
2.15.7
CONFIGURATION

-

OS / ENVIRONMENT

AlmaLinux 9.3

molecule 6.0.3 using python 3.9 ansible:2.15.7 azure:23.5.3 from molecule_plugins containers:23.5.3 from molecule_plugins requiring collections: ansible.posix>=1.3.0 community.docker>=1.9.1 containers.podman>=1.8.1 default:6.0.3 from molecule docker:23.5.3 from molecule_plugins requiring collections: community.docker>=3.4.11 ansible.posix>=1.4.0

SUMMARY

When deploying an icinga2 agent on a debian based system the install of the dependencies (e.g. gnupg2) fails if there was never an apt update made on the system. In my case this happens while playbook testing using molecule with docker using the image geerlingguy/docker-debian11-ansible

This should be fixed by setting a update_cache: true in the Install dependencies for debian-based distributions task

STEPS TO REPRODUCE

Setup a minimal role which includes icinga2_agent and test it with molecule and a debian image like geerlingguy/docker-debian11-ansible

EXPECTED RESULTS

It works

ACTUAL RESULTS
ASK [ansible-role-icinga2_agent : Install dependencies for debian-based distributions] ***
failed: [instance] (item=gnupg2) => {"ansible_loop_var": "item", "changed": false, "item": "gnupg2", "msg": "No package matching 'gnupg2' is available"}
adf-patrickha commented 1 month ago

Has been fixed by now in https://github.com/adfinis/ansible-role-icinga2_agent/commit/4fa05906eeb4d155eebb3d15eaba1f107ec9f7af. Thx @Paul-Weisser for reporting!