You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was testing a role in Molecule that uses robertdebock.firewall as a dependency, and noticed the firewall wasn't configured or enabled. Looking in the code, I see tasks/main.yml installs packages as required, but then does nothing else.
This raises two questions for me:
Should the playbook even install packages in the docker context? Something like this as the first task (or as a later task if there's a reason for still installing the packages) could replace the docker part of the nine existing when checks (without failing the host):
- name: End the play for docker hosts.
meta: end_host
when: ansible_connection in [ "container", "docker", "community.docker.docker" ]
Would you be willing to include an override condition allowing the role to run in docker for CI etc? Then something like this should work:
- name: End the play for docker hosts (except when forced).
meta: end_host
when:
- ansible_connection in [ "container", "docker", "community.docker.docker" ]
- firewall_skip_on_docker
If firewall_skip_on_docker: true were provided as a default, it would permit existing consumers of the role to go about their business without changes.
If either/both of these (or some variant) appeals to you, I'd be happy to create an MR.
The text was updated successfully, but these errors were encountered:
I am in the same boat with this. I am trying to test a playbook with molecule docker using this role, and my tests simply fail because these get skipped over and don't actually apply on the container. It would be nice if I could simply override this, I'm struggling to find a workaround for this.
This isn't really a bug :)
I was testing a role in Molecule that uses
robertdebock.firewall
as a dependency, and noticed the firewall wasn't configured or enabled. Looking in the code, I seetasks/main.yml
installs packages as required, but then does nothing else.This raises two questions for me:
Should the playbook even install packages in the docker context? Something like this as the first task (or as a later task if there's a reason for still installing the packages) could replace the docker part of the nine existing
when
checks (without failing the host):Would you be willing to include an override condition allowing the role to run in docker for CI etc? Then something like this should work:
If
firewall_skip_on_docker: true
were provided as a default, it would permit existing consumers of the role to go about their business without changes.If either/both of these (or some variant) appeals to you, I'd be happy to create an MR.
The text was updated successfully, but these errors were encountered: