ikke-t / podman-container-systemd

creates systemd files and creates containers using podman
118 stars 44 forks source link

Tests loop over include_role #50

Closed cfelder closed 2 years ago

cfelder commented 2 years ago

This PR reproduces an error I discovered using this role in a loop since commit 3d03115a0df0d2e1bfae9cb854a8f0688b655733 which removes the following two tasks:

and uses handlers more extensively.

The following error is reported:

RUNNING HANDLER [podman-container-systemd : start service] *************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Could not find the requested service lighthttpd-2-container-pod-root.service: host"}

after running the first iteration (for lighthttpd-1).

The handler in iteration 1 in particular uses the variables from the second/last iteration.

I suspect this is because of the following fact:

Handlers are made available to the whole play https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_role_module.html

I am looking for a solution for this problem. Any suggestions?

ikke-t commented 2 years ago

Thanks! I recall I was wondering if the handlers work properly. Then forgot about it.