Some tests require the docker container to be started with additional capabilities such as --cap-add=SYS_ADMIN. This is supported by supplying the docker_extra_args parameter to the standard-test-docker role. The standard-inventory-docker dynamic inventory script needs to support something similar.
--cap-add=SYS_ADMIN
docker_extra_args
Since the exact (optional) capabilities needed are specific to the test suite being run, we can't require this to be set as an environment variable. Perhaps additional docker parameters can be stored in a configuration file in the tests directory that is read by standard-inventory-docker?
The intent of using dynamic inventory is that a test can supply its own inventory files in the test/inventory directory. These may be completely different than the standard-inventory-* scripts ... or (in this case) these test/inventory scripts may setup certain environment variables and then invoke other inventory files.
test/inventory
I would suggest the following approach:
Thank you for the suggestions. I'll start progress using that approach.
PR #33 should be sufficient to address this issue by enabling extra arguments for "docker run" to be taken from the DOCKER_EXTRA_ARGS environment variable. The rest is left up to a custom inventory script to be written and included in the tests/inventory directory.
DOCKER_EXTRA_ARGS
tests/inventory
This issue is addressed by PR #33, included in package update standard-test-roles-2.1 which is currently making its way to the rawhide and updates-testing repos. Note: the environment variable name was changed to TEST_DOCKER_EXTRA_ARGS.
standard-test-roles-2.1
TEST_DOCKER_EXTRA_ARGS
As noted above, it is still up to each test to supply (an) appropriate inventory wrapper script(s) to provide the necessary settings to the scripts installed in /usr/share/ansible/inventory.
/usr/share/ansible/inventory
See PR#36 for an inventory merge script that finishes resolving this issue by allowing a single simple custom inventory script to wrap all of the scripts installed in /usr/share/ansible/inventory.
PR#36 solves this issue. Closing.
Metadata Update from @stefw: - Issue assigned to stefw
Metadata Update from @stefw: - Issue status updated to: Closed (was: Open)
Metadata Update from @stefw: - Assignee reset