provision_docker icon indicating copy to clipboard operation
provision_docker copied to clipboard

impossible to test idempotency of a role

Open marcomc opened this issue 6 years ago • 2 comments

re-running the test that makes use of provision_docker would recreate a docker container making impossible to test idempotency of a role (or set of roles) over the same container I have tried to set the item's restart attribute to false from the inventory, host_vars file and event as vars in the same playbook but the container would always be rebuilt (with a new Container ID) every time the "Bring up inventory group of hosts" task is executed

marcomc avatar Jun 18 '18 20:06 marcomc

what actually triggers the recreation of the container indiscriminately is the attribute network_mode if set to none it will not rebuild the container...but makes the test useless because you cannot install external componets on it (apt or yum packages for instance)

marcomc avatar Jun 18 '18 23:06 marcomc

Maybe a state: present term would be useful since you could then re-run and check idempotency of a role, or connect to an already present docker container. Making this module potentially usable for creating docker infrastructure and provisioning it for mimicing production environments in docker for development.

iainvm avatar Oct 16 '18 19:10 iainvm