Commit Graph

27 Commits

Author SHA1 Message Date
Felix Fontein
f4b1d34357
Fix CI (docker_container tests fail because of missing ipaddress) (#218)
* Use stdlib ipaddress, resp. install when needed.

* Make sure facts on controller are available.
2021-10-07 13:15:51 +02:00
Felix Fontein
4070dab9a8
Remove deprecated features, bump version to 2.0.0 (#210)
* Remove docker_login's email option.

* container_default_behavior now has default value no_defaults.

* Disallow 'all' next to other ports. Deprecate 'all' in favor of publish_all_ports.

* Change default for network_mode.

* Add changelog fragment.

* Fix tests.

* Next expected release is 2.0.0.
2021-10-05 17:39:42 +02:00
Felix Fontein
5a3ce51049
Improve CI (#198)
* Use remote temp path, replace remote lookups.

* Copy local files.

* Change docker resource name prefix from ansible-test to ansible-docker-test to avoid collision with ansible-test's containers.

* Fix typos.

* We don't neceessarily have a TTY.

* Use hopefully less collision-likely subnet.

* More collision avoidance.

* More changes.
2021-09-08 09:43:35 +02:00
Felix Fontein
6f52747693
docker_container: fix handling of command and entrypoint in a backwards-compatible way (#186)
* Fix handling of command and entrypoint in a backwards-compatible way.

* Fix copy'n'paste error.

* Fix some more.

* Improve documentation.

* Keep command and entrypoint as lists and not as strings.

* Simplify code, since we're already emitting the deprecation warning in this case during parameter processing.

* Change default only in community.docker 3.0.0.

* Update tests/integration/targets/docker_container/tasks/tests/options.yml

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

* Apply suggestion to more places.

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2021-08-02 19:31:46 +02:00
Ajpantuso
b2430f756f
Allowing anonymous volumes via mounts option (#181)
* Initial Commit

* Adding changelog fragment
2021-07-27 17:35:40 +00:00
Felix Fontein
e2785de840
Make sure that 'container' is returned in more circumstances, and improve documentation when it is actually returned (#178)
* Make sure that 'container' is returned in more circumstances, and improve documentation when it is actually returned.

* Fix typos.
2021-07-24 21:01:14 +02:00
Ajpantuso
49cb513244
docker_container - adding publish_all_ports option (#162)
* Initial commit

* Adding changelog fragment

* Updating deprecation notice

* Adding integration test

* Applying second round of review suggestions

* Updating docs and cleaning up integration tests

* Updating test loop logic
2021-06-27 16:51:30 +02:00
Shane St Savage
a512e7fb9e
feat: allow unlimited memory_swap in docker_container (#138)
* feat: allow unlimited memory_swap in docker_container

summary: in docker_container, allow `memory_swap: values
`unlimited` and `-1` for unlimited container swap usage.

`--memory-swap=-1` is a valid docker run value allowing
unlimited swap usage. `docker_container` should allow
setting this value via `memory_swap` values `unlimited`
and `-1` as it sometimes must explicitly be set to prevent
docker from attempting to limit swap usage to double the
`--memory` value by default. In rootless docker environments,
attempting to set `memory-swap` usage limits will result in an error
if the user doesn't have the ability to do so. Allowing explicit
unlimited swap usage via docker_container will prevent these errors.

https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details

* Update tests/integration/targets/docker_container/tasks/tests/options.yml

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-10 20:24:04 +02:00
Felix Fontein
f107ab281f
Add storage_opts option. (#93) 2021-02-24 23:01:34 +01:00
Felix Fontein
f5d68755c4
Fix healthcheck idempotency issue with strict comparison. (#88) 2021-02-17 22:56:52 +01:00
Felix Fontein
dffbca3847
Use ipaddress vendored in community.crypto. (#78) 2021-01-30 16:00:16 +01:00
Felix Fontein
c1e6c2e699
Fix IPv6 zone handling (#66)
* Support IPv6 zones (RFC 4007).

* Add changelog fragment.

* Remove change for docker_network.

* Add IPv6 zone test.

It looks like an arbitrary zone name works. If Docker daemon ever starts
validating it (against what?) we either have to try to fix this test by
a valid value, or remove it again.
2021-01-25 15:16:35 +01:00
Felix Fontein
6adb148675
Add default_host_ip option. (#71) 2021-01-20 23:53:23 +01:00
Felix Fontein
c7a3d9f057
docker_container: cgroup_parent (#59)
* Document that the Docker SDK for Python is used by the module.

* Allow to specify cgroup_parent for container.
2021-01-03 13:30:09 +01:00
Felix Fontein
e4b747d788
docker_container: return status also when 0 for non-detached containers (#58)
* Return status also when 0.

* Fix PR number.
2021-01-02 18:53:25 +01:00
Felix Fontein
ebafa17b02
[WIP] Fix CI (#50)
* Centralize location of images for runme.sh tests.

* Switch images.

* Fix sanity.

* Fix image names.

* Fix tag chaos.

* One more.
2020-12-15 13:57:38 +01:00
Felix Fontein
fe2d52ff29
Fix AZP tests, add current_container_facts module (#48)
* Add new facts module for determining whether the module is running inside a container or not.

* Add containers to main network.

* Fix running tests locally with newer docker.

* Simplify setup_openssl to only install cryptography.

* Add alias in network.

* Make sure to upgrade cryptography to something more sensible on Ubuntu 16.04.

* Don't jump through hoops for bridge.

* Try to use other IPv4 nets.

* Improve module docs.
2020-12-13 08:06:16 +00:00
Felix Fontein
219c6b3a85
Improve and fix tests (#36)
* Parameterize test images.

* Use different images, similar to ansible/ansible#72698.
2020-11-23 21:48:46 +01:00
Felix Fontein
5dba331bc7 Adjust deprecations (#1)
* First batch of c.g 2.0.0 deprecations.

* Remove use_tls and force from docker_image.

* More removals.

* Change community.general 3.0.0 deprecations to community.docker 2.0.0.

* Fix sanity.

* Fixing some bugs.

* Add PR URL to fragment.

ci_complete
ci_coverage

* Improve docs, remove superfluous code.
2020-10-30 07:05:51 +01:00
Felix Fontein
6555a5a0de Initial cleanup. 2020-10-30 07:05:51 +01:00
Felix Fontein
a8835f5bf5 docker_container: add device_requests option (#1119)
* docker_container: add device_requests option.

* Fix copy'n'paste mistake.

* Fix failure test.

* Added example.

* Adjust tense.
2020-10-30 07:05:51 +01:00
Felix Fontein
765f31a673 Run tests with macOS 10.15. (#971)
* Run tests with macOS 10.15.

* Restrict to macOS CI runs for now until they pass.

* Skip tests on macOS that are skipped on OSX.

* Disable consul test for macOS.

* Disable chroot connection tests for macOS.

* Add setup_gnutar role from https://github.com/ansible/ansible/pull/71841.

* Use setup_gnutar for yarn and npm tests.

* Revert "Restrict to macOS CI runs for now until they pass."

This reverts commit d945d0399f1727a5fe5942089c74d6662bd2b045.

* hashi_vault lookup tests seem to be always unstable, disabling for now.

* Use homebrew module instead of command.
2020-10-30 07:05:51 +01:00
Felix Fontein
773a2a5316 docker_container: fix idempotency problem with empty published_ports list (#979)
* Distinguish between [] and None.

* Add changelog fragment.

* Fix typo.
2020-10-30 07:05:51 +01:00
Andrew Klychkov
9b8c8a8701 Add headers to ci tests (#954)
* CI tests: add note to main.yml

* improve
2020-10-30 07:05:51 +01:00
Felix Fontein
3c00bc53a7 Fix docker_container tests (#549)
* Stop using ansible.netcommon.next_nth_usable.

It requires netaddr to be installed before running the playbook, which isn't the case in CI.
This undoes cf61474c3b.

* Use own filter to avoid needing netaddr installed.
2020-10-30 07:05:51 +01:00
Felix Fontein
fe2eded15a Fix more tests (#66)
* Fix permissions.

* Fix more FQCNs.

* Adjust more ansible_pkg_mgr usages.

* Fix plugin FQCN.

* Change port 12345 -> 12347.

* Print port usage first.

* Support both short and long name.

* Revert "Print port usage first."

This reverts commit ea1dbc60f08a2664a8b01abba7aa7610bc2a23f1.

* Revert "Change port 12345 -> 12347."

This reverts commit cbc13510ee9f855110b4134517b2a548745a1fb0.

* Fix cleanup.

* Add more FQCNs.

* Allow short name as well.

ci_complete

* Add remaining ignore.txt entries for ipaddress.

* Remove kubevirt ignore.txt entries.

* Added missing entries, and sorted.

* Remove superfluous fact gathering.

* Fix FQCNs.

* Temporarily disable supervisorctl (fails on OSX because socket path is too long)

* Add missing file.

* Fix permissions.

ci_complete
2020-10-30 07:05:51 +01:00
Ansible Core Team
a1f472244d Initial commit 2020-10-30 07:05:50 +01:00