Commit Graph

465 Commits

Author SHA1 Message Date
Felix Fontein
70ea796914 Release 3.4.9. 2023-10-08 21:35:36 +02:00
Felix Fontein
be610963b5 Prepare 3.4.9 release. 2023-10-08 18:38:22 +02:00
Felix Fontein
377f0f7355 Release 3.4.8. 2023-06-22 10:49:45 +02:00
Felix Fontein
a1c5a2d342 Update release summary. 2023-06-22 07:02:40 +02:00
Felix Fontein
5b287b6650 Next expected release is 3.4.8. 2023-06-15 13:35:05 +02:00
Felix Fontein
e5d289a650 Release 3.4.7. 2023-06-15 13:15:25 +02:00
Felix Fontein
440669e76d Prepare 3.4.7 release. 2023-06-15 07:22:20 +02:00
Felix Fontein
748d619fb2
Fix EndpointSpec KeyError. (#637) 2023-05-26 17:58:09 +02:00
Felix Fontein
a284137d15 Release 3.4.6. 2023-05-20 21:14:49 +02:00
Felix Fontein
cdccf955a8 Prepare 3.4.6. 2023-05-20 19:38:28 +02:00
Felix Fontein
1660bf4104
vendored Docker SDK for Python code: update to latest version (#619)
* socket: fix for errors on pipe close in Windows (https://github.com/docker/docker-py/pull/3099)

Need to return data, not size. By returning an empty
string, EOF will be detected properly since `len()`
will be `0`.

Fixes https://github.com/docker/docker-py/issues/3098.

Cherry-picked from f84623225e

Co-authored-by: Milas Bowman <milas.bowman@docker.com>

* socket: use poll() instead of select() except on Windows (https://github.com/docker/docker-py/pull/2865)

Fixes https://github.com/docker/docker-py/issues/2278, which was originally addressed in https://github.com/docker/docker-py/pull/2279, but was not
properly merged. Additionally it did not address the problem
of poll not existing on Windows. This patch falls back on the
more limited select method if host system is Windows.

Cherry-picked from a02ba74333

Co-authored-by: Tyler Westland <tylerofthewest@gmail.com>

* api: respect timeouts on Windows named pipes (https://github.com/docker/docker-py/pull/3112)

Cherry-picked from 9cadad009e

Co-authored-by: Imogen <59090860+ImogenBits@users.noreply.github.com>

* Add URL to changelog.

* api: avoid socket timeouts when executing commands (https://github.com/docker/docker-py/pull/3125)

Only listen to read events when polling a socket in order
to avoid incorrectly trying to read from a socket that is
not actually ready.

Cherry-picked from c5e582c413

Co-authored-by: Loïc Leyendecker <loic.leyendecker@gmail.com>

---------

Co-authored-by: Milas Bowman <milas.bowman@docker.com>
Co-authored-by: Tyler Westland <tylerofthewest@gmail.com>
Co-authored-by: Imogen <59090860+ImogenBits@users.noreply.github.com>
Co-authored-by: Loïc Leyendecker <loic.leyendecker@gmail.com>
2023-05-20 19:35:56 +02:00
Felix Fontein
d7f7e44b9e
Make sure plugins/module_utils/socket_handler.py works when Docker SDK for Python is not installed. (#620) 2023-05-15 21:43:31 +02:00
Felix Fontein
245ab76b09
Warn that SSLSocket cannot send close_notify TLS alerts (#621)
* Warn that SSLSocket cannot send close_notify TLS alerts.

* Improve formulation.

Co-authored-by: Don Naro <dnaro@redhat.com>

---------

Co-authored-by: Don Naro <dnaro@redhat.com>
2023-05-15 21:41:23 +02:00
Felix Fontein
ce16a0d5f1 Release 3.4.5. 2023-05-05 22:23:19 +02:00
Felix Fontein
39f2e9b9c4
Make compatible with requests 2.29.0 and urllib3 2.0 (#613)
* Make compatible with requests 2.29.0.

* This fix should also work with urllib3 2.0 according to urllib3 maintainer.

* Add changelog fragment.

* We still need the constraint for CI until Docker SDK for Python has a new release with a fix.

* Make modifications to response_class as small as possible.

* Revert "We still need the constraint for CI until Docker SDK for Python has a new release with a fix."

This reverts commit 698d544a1e08308e8bf8b4e56ab78c5079f9a17b.

* The pip coming with the ansible-core 2.11 alpine3 image seems to be too old.
2023-05-05 22:09:02 +02:00
Felix Fontein
5a26eee6d4 Prepare 3.4.5. 2023-05-05 21:22:57 +02:00
Felix Fontein
0475be5166 Release 3.4.4. 2023-05-01 09:54:42 +02:00
Felix Fontein
ba5b3306a7 Also mention urllib3 2.0.0 in known_issues. 2023-05-01 09:51:38 +02:00
Felix Fontein
4ab05500e3 Prepare 3.4.4 release. 2023-05-01 09:47:48 +02:00
Felix Fontein
088cbaed4e
Restrict requests to < 2.29.0 (#612)
* Restrict requests to < 2.29.0.

* Also avoid urllib3, which gets installed in some cases even though it shouldn't.
2023-04-29 16:25:07 +02:00
Felix Fontein
e0f4c33782 Release 3.4.3. 2023-03-24 07:19:39 +01:00
Felix Fontein
65407001ff Prepare 3.4.3 release. 2023-03-23 21:27:15 +01:00
Felix Fontein
82dde7cadd Release 3.4.2. 2023-02-25 15:37:21 +01:00
Felix Fontein
18584f6b40 Prepare 3.4.2 release. 2023-02-24 21:36:26 +01:00
Felix Fontein
08bfcf7e5f
docker_prune: correctly return 'changed' result (#593)
* Correctly return 'changed' status.

* Extend tests.

* Fix typo.
2023-02-24 17:24:16 +01:00
Felix Fontein
5dd90e5884 Release 3.4.1. 2023-02-20 22:39:26 +01:00
Felix Fontein
983b2b4783
exec: fix file handle leak with container.exec_* APIs (https://github.com/docker/docker-py/pull/2320) (#582)
Requests with stream=True MUST be closed or else the connection will
never be returned to the connection pool. Both ContainerApiMixin.attach
and ExecApiMixin.exec_start were leaking in the stream=False case.
exec_start was modified to follow attach for the stream=True case as
that allows the caller to close the stream when done (untested).

Tested with:

    # Test exec_run (stream=False) - observe one less leak
    make integration-test-py3 file=models_containers_test.py' -k test_exec_run_success -vs -W error::ResourceWarning'
    # Test exec_start (stream=True, fully reads from CancellableStream)
    make integration-test-py3 file=api_exec_test.py' -k test_execute_command -vs -W error::ResourceWarning'

After this change, one resource leak is removed, the remaining resource
leaks occur because none of the tests call client.close().

Fixes https://github.com/docker/docker-py/issues/1293
(Regression from https://github.com/docker/docker-py/pull/1130)

Cherry-picked from 34e6829dd4

Co-authored-by: Peter Wu <pwu@cloudflare.com>
Co-authored-by: Milas Bowman <milas.bowman@docker.com>
2023-02-12 08:29:28 +01:00
Felix Fontein
5c70d8fd7a Prepare 3.4.1 release. 2023-02-10 14:06:22 +01:00
Kristof Mattei
d2f551fc5d
fix: fix tmpfs_size and tmpfs_mode not being set (#580)
* fix: fix tmpfs_size and tmpfs_mode not being set

* fix: wrong file

* fix: add changelog fragment

* fix: update changelog fragment to match formatting

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-02-10 14:05:09 +01:00
Felix Fontein
54a3dc151d
Remove unneccessary imports (#575)
* Remove unneccessary imports.

* Add noqas.
2023-02-09 15:25:45 +01:00
Felix Fontein
96b6f5917d Release 3.4.0. 2023-01-14 11:20:16 +01:00
Felix Fontein
c7cbec0163
docker_plugin: do not crash when plugin doesn't exist (#553)
* Do not crash when plugin doesn't exist.

* Improve style.

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

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2023-01-13 20:49:06 +01:00
Felix Fontein
4e6ac335f3
Improve envvar fallback handling. (#554) 2023-01-13 06:37:04 +01:00
Felix Fontein
757b02cc15 Prepare 3.4.0 release. 2023-01-09 11:54:13 +01:00
Felix Fontein
e198e4ab43
Add docker_container_copy_into module (#545)
* Move copying functionality to module_utils.

* Add docker_container_copy_into module.

* Use new module in other tests.

* Fix copyright and attributes.

* Improve idempotency, improve stat code.

* Document and test when a stopped container works.

* Improve owner/group detection error handling when container is stopped.

* Fix formulation.

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

* Improve file comparison.

* Avoid reading whole file at once.

* Stream when fetching files from daemon.

* Fix comment.

* Use read() instead of read1().

* Stream files when copying into container.

* Linting.

* Add force parameter.

* Simplify library code.

* Linting.

* Add content and content_is_b64 options.

* Make force=false work as for copy module: only copy if the destination does not exist.

* Improve docs.

* content should be no_log.

* Implement diff mode.

* Improve error handling.

* Lint and improve.

* Set owner/group ID to avoid ID lookup (which fails in paused containers).

* Apply suggestions from code review

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

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2023-01-09 11:52:29 +01:00
Felix Fontein
18091193de
Fix error handling. (#546) 2023-01-05 09:42:42 +01:00
Felix Fontein
faa7fef504
docker_host_info: allow to list all containers (#538)
* Allow to list all containers.

* Fix typo.
2022-12-27 21:39:17 +01:00
Felix Fontein
b8fb4740a3 Release 3.3.2. 2022-12-09 21:27:38 +01:00
Felix Fontein
6db26903ed Prepare 3.3.2 release. 2022-12-08 22:16:57 +01:00
Felix Fontein
3a40112a76
Remove timeout when waiting for container to finish. (#527) 2022-12-08 22:15:42 +01:00
Felix Fontein
080a043c79 Release 3.3.1. 2022-12-06 13:21:27 +01:00
Felix Fontein
ed48629399 Prepare 3.3.1 release. 2022-12-06 08:15:55 +01:00
Felix Fontein
e87b327764
Improve container detection. (#522) 2022-12-06 08:11:44 +01:00
Felix Fontein
ffff6b7e77 Release 3.3.0. 2022-12-03 21:15:34 +01:00
Felix Fontein
6ccbde9f98
Fix chdir option. (#518) 2022-12-02 06:48:39 +01:00
Felix Fontein
2957138153
latest docker-py bugfix (npipe) (#513)
* socket: handle npipe close on Windows (https://github.com/docker/docker-py/pull/3056)

Fixes https://github.com/docker/docker-py/issues/3045

Cherry-picked from 30022984f6

Co-authored-by: Nick Santos <nick.santos@docker.com>

* Add changelog fragment.

Co-authored-by: Nick Santos <nick.santos@docker.com>
2022-12-01 06:59:05 +01:00
Felix Fontein
a239c0b2db Prepare 3.3.0 release. 2022-12-01 00:04:00 +01:00
iamjpotts
166d485216
Make image archive/save idempotent, using image id and repo tags as keys (#500) 2022-11-30 23:45:36 +01:00
Felix Fontein
c2d84efccb
Make current_container_facts work with newer Docker versions and latest ansible-test container changes (#510)
* Add more debug output.

* Add basic integration test.

* Split into lines.

* Fix docker detection, add podman detection.

ci_complete

* Improve regular expression.

* Document that this module is trying its best, but might not be perfect.

* Update comment.
2022-11-30 22:25:33 +01:00
Felix Fontein
5b4d24a817 Release 3.2.2. 2022-11-28 22:30:20 +01:00
Felix Fontein
9ab3130b43 Prepare 3.2.2 release. 2022-11-28 22:11:07 +01:00
Felix Fontein
edf0d3ec99
Make kill_signal accept strings. (#506) 2022-11-28 22:10:07 +01:00
Felix Fontein
1427a7ccdd Release 3.2.1. 2022-11-06 22:02:10 +01:00
Felix Fontein
c7f5c74f15 Prepare 3.2.1 release. 2022-11-06 21:16:18 +01:00
Felix Fontein
79b05f5e1d Release 3.2.0. 2022-11-01 21:18:46 +01:00
Felix Fontein
5b31f17016
Add image_name_mismatch option. (#488) 2022-11-01 19:48:58 +00:00
Felix Fontein
4e1bb64b0a Prepare 3.2.0 release. 2022-11-01 20:48:21 +01:00
Felix Fontein
51d5744cb0
docker_container: deprecate ignore_image and purge_networks (#487)
* Deprecate ignore_image and purge_networks.

* Fix YAML.

* Simple replacement doesn't work in this case.
2022-11-01 19:57:56 +01:00
Felix Fontein
a72d7795c4 Release 3.1.0. 2022-09-08 06:51:36 +02:00
Felix Fontein
d159479615 Prepare 3.1.0 release. 2022-09-03 12:08:05 +02:00
Max
c9ea1d3f92
docker_swarm: add data_path_port option for swarm init (#466)
* Add data_path_port option for swarm init and swarm join

* Add changelog fragment

* Update changelogs/fragments/466-add-data-path-port.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/docker_swarm.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* add change for docker sdk, remove reference to swarm join

* remove duplicate entry

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-03 11:20:02 +02:00
Felix Fontein
68ea9c5f41
Make reuse conformant (#462)
* Add .license files.

* Add reuse test.

* Update README.

* Add changelog fragment.

* Normalize licenses extra sanity test.

* Declare REUSE conformance.

* Update README.
2022-08-21 08:29:15 +02:00
Felix Fontein
8eabc7fe00 Release 3.0.2. 2022-08-16 22:47:57 +02:00
Felix Fontein
d8297df7d0
Fix docker_image's build.args (#456)
* Add tests for build.args.

* Fix bug: store build args in correct dict

* Add changelog fragment.

* Update copyright notice.
2022-08-16 22:37:51 +02:00
Felix Fontein
03ecea94c0 Prepare 3.0.2 release. 2022-08-16 13:48:02 +02:00
Felix Fontein
fbac2ecc3d Release 3.0.1. 2022-08-15 08:02:34 +02:00
Felix Fontein
f7cf12555c
docker_container: fix env_file option (#452)
* Add better tests for env and env_file.

* Make sure that non-container options are also passed to preprocessing code.

* Add changelog fragment.

* Add env_file override test.
2022-08-15 07:45:59 +02:00
Felix Fontein
f9741b7457 Prepare 3.0.1 release. 2022-08-14 12:26:23 +02:00
Felix Fontein
be4f333696 Release 3.0.0. 2022-08-12 22:03:48 +02:00
Felix Fontein
a50257381f
Fix docker_plugin crash when handling plugin options (#447)
* Fix docker_plugin crash when handling plugin options.

* Try to add tests.
2022-08-12 19:29:45 +02:00
Felix Fontein
f513ba2c59
Fix error formatting bug. (#448) 2022-08-12 13:53:59 +02:00
Felix Fontein
5b76f05bef Prepare 3.0.0 release. 2022-08-10 21:49:56 +02:00
Felix Fontein
1e4633a606
For Python > 2, always use shutil.which instead of custom Windows helper code. (#438)
This is related to
42789818be
in the sense that for Python > 2, we also exclusively use shutil.which now,
but we do not remove the helper function since we need it for Python 2 on Windows.

Co-authored-by: Daniel Möller <n1ngu@riseup.net>

Co-authored-by: Daniel Möller <n1ngu@riseup.net>
2022-08-08 20:58:12 +02:00
Felix Fontein
b2bb064e47 Release 3.0.0-rc2. 2022-07-31 17:50:47 +02:00
Felix Fontein
da9b076904 Prepare 3.0.0-rc2. 2022-07-31 17:11:48 +02:00
Felix Fontein
ae708a7333
Vendored Docker SDK for Python updates (#434)
* utils: fix IPv6 address w/ port parsing

This was using a deprecated function (`urllib.splitnport`),
ostensibly to work around issues with brackets on IPv6 addresses.

Ironically, its usage was broken, and would result in mangled IPv6
addresses if they had a port specified in some instances.

Usage of the deprecated function has been eliminated and extra test
cases added where missing. All existing cases pass as-is. (The only
other change to the test was to improve assertion messages.)

Cherry-picked from
f16c4e1147

Co-authored-by: Milas Bowman <milas.bowman@docker.com>

* client: fix exception semantics in _raise_for_status

We want "The above exception was the direct cause of the following exception:" instead of "During handling of the above exception, another exception occurred:"

Cherry-picked from
bb11197ee3

Co-authored-by: Maor Kleinberger <kmaork@gmail.com>

* tls: use auto-negotiated highest version

Specific TLS versions are deprecated in latest Python, which
causes test failures due to treating deprecation errors as
warnings.

Luckily, the fix here is straightforward: we can eliminate some
custom version selection logic by using `PROTOCOL_TLS_CLIENT`,
which is the recommended method and will select the highest TLS
version supported by both client and server.

Cherry-picked from
56dd6de7df

Co-authored-by: Milas Bowman <milas.bowman@docker.com>

* transport: fix ProxyCommand for SSH conn

Cherry-picked from
4e19cc48df

Co-authored-by: Guy Lichtman <glicht@users.noreply.github.com>

* ssh: do not create unnecessary subshell on exec

Cherry-picked from
bb40ba051f

Co-authored-by: liubo <liubo@uniontech.com>

* ssh: reject unknown host keys when using Python SSH impl

In the Secure Shell (SSH) protocol, host keys are used to verify the identity of remote hosts. Accepting unknown host keys may leave the connection open to man-in-the-middle attacks.

Do not accept unknown host keys. In particular, do not set the default missing host key policy for the Paramiko library to either AutoAddPolicy or WarningPolicy. Both of these policies continue even when the host key is unknown. The default setting of RejectPolicy is secure because it throws an exception when it encounters an unknown host key.

Reference: https://cwe.mitre.org/data/definitions/295.html

NOTE: This only affects SSH connections using the native Python SSH implementation (Paramiko), when `use_ssh_client=False` (default). If using the system SSH client (`use_ssh_client=True`), the host configuration
(e.g. `~/.ssh/config`) will apply.

Cherry-picked from
d9298647d9

Co-authored-by: Audun Nes <audun.nes@gmail.com>

* lint: fix deprecation warnings from threading package

Set `daemon` attribute instead of using `setDaemon` method that
was deprecated in Python 3.10.

Cherry-picked from
adf5a97b12

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>

* api: preserve cause when re-raising error

Use `from e` to ensure that the error context is propagated
correctly.

Cherry-picked from
05e143429e

Co-authored-by: Milas Bowman <milas.bowman@docker.com>

* build: trim trailing whitespace from dockerignore entries

Cherry-picked from
3ee3a2486f

Co-authored-by: Clément Loiselet <clement.loiselet@capgemini.com>

* Improve formulation, also mention the security change as a breaking change.

Co-authored-by: Milas Bowman <milas.bowman@docker.com>
Co-authored-by: Maor Kleinberger <kmaork@gmail.com>
Co-authored-by: Guy Lichtman <glicht@users.noreply.github.com>
Co-authored-by: liubo <liubo@uniontech.com>
Co-authored-by: Audun Nes <audun.nes@gmail.com>
Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
Co-authored-by: Clément Loiselet <clement.loiselet@capgemini.com>
2022-07-31 17:09:18 +02:00
Felix Fontein
e90647b209 Release 3.0.0-rc1. 2022-07-26 08:59:01 +02:00
Felix Fontein
cc55aeb882 Prepare 3.0.0-rc1. 2022-07-26 08:28:25 +02:00
Felix Fontein
9c5d562c0e
Fix bug when TLS is used (#432)
* Fix bug when TLS is used.

* Add HTTP/HTTPS connection test.
2022-07-26 08:25:53 +02:00
Felix Fontein
6caaa3a90b Release 3.0.0-a3. 2022-07-23 15:21:05 +02:00
Felix Fontein
ca3d7a3609 Prepare 3.0.0-a3 release. 2022-07-23 15:10:51 +02:00
Felix Fontein
a4539a309e
Move licenses to LICENSES/, use SPDX-License-Identifier, mention all licenses in galaxy.yml (#430)
* Move licenses to LICENSES/, use SPDX-License-Identifier, mention all licenses in galaxy.yml.

* ignore.txt lines cannot be empty or contain only a comment.

* Cleanup.

* This particular __init__.py seems to be crucial.

* Try extra newline.

* Markdown comments are a real mess. I hope this won't break Galaxy...

* More licenses.

* Add sanity test.

* Skip some files, lint.

* Make sure there is a copyright line everywhere.

* Also check for copyright line in sanity tests.

* Remove colon after 'Copyright'.

* Normalize lint script.

* Avoid colon after 'Copyright' in lint script.

* Improve license checker.

* Update README.md

Co-authored-by: Maxwell G <9920591+gotmax23@users.noreply.github.com>

* Remove superfluous space.

* Referencing target instead of symlink

Co-authored-by: Maxwell G <9920591+gotmax23@users.noreply.github.com>
2022-07-20 07:45:33 +02:00
Felix Fontein
0e3d7d4802 Release 3.0.0-a2. 2022-07-15 19:28:10 +02:00
Felix Fontein
e26890a909
Implement platform parameter for docker_container, first version. (#426) 2022-07-15 17:14:57 +02:00
Felix Fontein
5d0a036819
docker_container: add image_comparison parameter (#428)
* Add image_comparison parameter.

* Forgot version_added.
2022-07-15 17:14:40 +02:00
Felix Fontein
37c868e192
Add support for cgroupns_mode parameter. (#427) 2022-07-15 17:14:23 +02:00
Felix Fontein
2f1d9b3ff9 Prepare 3.0.0-a2 release. 2022-07-15 14:10:49 +02:00
Felix Fontein
77e63e2cca
Rewrite docker_container to use Docker API directly (#422)
* Begin experiments for docker_container rewrite.

* Continued.

* We support API >= 1.25 only anyway.

* Continued.

* Fix bugs.

* Complete first basic implementation.

* Continuing.

* Improvements and fixes.

* Continuing.

* More 'easy' options.

* More options.

* Work on volumes and mounts.

* Add more options.

* The last option.

* Copy over.

* Fix exposed ports.

* Fix bugs.

* Fix command and entrypoint.

* More fixes.

* Fix more bugs.

* ci_complete

* Lint, fix Python 2.7 bugs, work around ansible-test bug.

ci_complete

* Remove no longer applicable test.

ci_complete

* Remove unnecessary ignore.

ci_complete

* Start with engine driver.

* Refactoring.

* Avoid using anything Docker specific from self.client.

* Refactor.

* Add Python 2.6 ignore.txt entries for ansible-core < 2.12.

* Improve healthcheck handling.

* Fix container removal logic.

* ci_complete

* Remove handling of older Docker SDK for Pyhon versions from integration tests.

* Avoid recreation if a pure update is possible without losing the diff data.

* Cover the case that blkio_weight does not work.

* Update plugins/module_utils/module_container/docker_api.py

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

* Improve memory_swap tests.

* Fix URLs in changelog fragment.

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2022-07-15 07:24:14 +02:00
Felix Fontein
04121b5882
Rewrite docker_plugin to not use the Docker SDK for Python (#429)
* Rewrite the docker_plugin module to use the low-level client from Docker SDK for Python.

* Rewrite to no longer use the Docker SDK for Python.

* Remove Docker SDK for Python version from tests.
2022-07-14 16:29:37 +02:00
Felix Fontein
b90cc8b3f9 Release 3.0.0-a1. 2022-07-07 07:07:55 +02:00
Felix Fontein
848e21d253 Prepare 3.0.0-a1 release. 2022-07-06 22:40:00 +02:00
Felix Fontein
da9252a67e
Rewrite the docker_api connection plugin (#414)
* Rewrite the docker_api connection plugin.

* Improve formulation.

* Improve error messages.
2022-07-06 21:48:55 +02:00
Felix Fontein
23a90668c9
Rewrite the docker_containers inventory plugin (#413)
* Rewrite the docker_containers inventory plugin.

* Improve error messages.
2022-07-06 21:48:32 +02:00
Felix Fontein
c3a76007d0
Rewrite the docker_volume_info module (#412)
* Rewrite the docker_volume_info module.

* Improve error messages.
2022-07-06 21:48:22 +02:00
Felix Fontein
6869eaf869
Rewrite the docker_volume module (#411)
* Rewrite the docker_volume module.

* Improve error messages.
2022-07-06 21:48:16 +02:00
Felix Fontein
e60ce69102
Rewrite the docker_prune module (#410)
* Rewrite the docker_prune module.

* Improve error messages.
2022-07-06 21:47:43 +02:00
Felix Fontein
18fdd04782
Rewrite the docker_network_info module (#409)
* Rewrite the docker_network_info module.

* Improve error messages.
2022-07-06 21:47:37 +02:00
Felix Fontein
4c026307fb
Rewrite the docker_network module (#408)
* Rewrite the docker_network module.

* Update plugins/modules/docker_network.py

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

* Improve error messages.

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2022-07-06 21:47:32 +02:00
Felix Fontein
a406b08981
Rewrite the docker_login module (#407)
* Rewrite the docker_login module.

* Improve error messages.
2022-07-06 21:47:27 +02:00
Felix Fontein
f82c8401c2
Rewrite the docker_image_load module (#406)
* Rewrite the docker_image_load module.

* Improve error messages.
2022-07-06 21:46:19 +02:00
Felix Fontein
e4f3402035
Rewrite the docker_image_info module (#405)
* Rewrite the docker_image_info module.

* Improve error messages.
2022-07-06 21:46:14 +02:00
Felix Fontein
4f2f45b953
Rewrite the docker_image module (#404)
* Rewrite the docker_image module.

* Improve error messages.
2022-07-06 21:46:02 +02:00
Felix Fontein
9e168b75cf
Rewrite the docker_host_info module (#403)
* Rewrite the docker_host_info module.

* Improve error messages.
2022-07-06 21:45:57 +02:00
Felix Fontein
37ff980a44
Rewrite the docker_container_info module (#402)
* Rewrite the docker_container_info module.

* Improve error messages.

* Remove wrong requirement.
2022-07-06 21:45:51 +02:00
Felix Fontein
1101997844
Rewrite the docker_container_exec module (#401)
* Rewrite docker_container_exec.

* Improve error messages.
2022-07-06 21:45:44 +02:00
Felix Fontein
9e57f29b3b
Refactoring. (#415) 2022-07-03 13:28:11 +02:00
Felix Fontein
623786c659
Implement all remaining deprecations for 3.0.0 (#400)
* Remove support for Ansible 2.9 and ansible-base 2.10.

* Remove Ansible 2.9 compatiblity code.

* Remove docker-compose from EE.

* Drop support for Python 2.6. Stop advertising docker-py for Python 2.6.

* Drop support for API versions 1.20 to 1.24.

* Fix condition.
2022-07-02 17:13:53 +02:00
Felix Fontein
4d508b4c37
Vendor API connection code from Docker SDK for Python (#398)
* Vendor parts of the Docker SDK for Python

This is a combination of the latest git version
(a48a5a9647)
and the version before Python 2.7 support was removed
(650aad3a5f),
including some modifications to work with Ansible module_utils's
system (i.e. third-party imports are guarded, and errors are
reported during runtime through a new exception
MissingRequirementException).

* Create module_utils and plugin_utils for working with the vendored code.

The delete call cannot be called delete() since that method already exists from requests.

* Vendor more code from Docker SDK for Python.

* Adjust code from common module_utils.

* Add unit tests from Docker SDK for Python.

* Make test compile with Python 2.6, but skip them on Python 2.6.

* Skip test that requires a network server.

* Add changelog.

* Update changelogs/fragments/398-docker-api.yml

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

* Minimum API version is 1.25.

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2022-07-02 16:40:44 +02:00
Felix Fontein
21d112bddb
Unvendor distutils.version (#271)
* Unvendor distutils.version.

* Document breaking change.

* Update comment, add StrictVersion.
2022-07-02 15:06:58 +02:00
Felix Fontein
bc64aef5ca Revert "Revert "Remove deprecated functionality. (#363)""
This reverts commit e6d597b539.
2022-07-02 14:28:31 +02:00
Felix Fontein
6206976dbb Revert "Revert "Remove deprecations from docker_container, bump collection version to 3.0.0 (#399)""
This reverts commit 57e19ca596.
2022-07-02 14:28:27 +02:00
Felix Fontein
86011cdfdf Release 2.7.0. 2022-07-02 14:22:03 +02:00
Felix Fontein
45f3657fb6 Prepare 2.7.0. 2022-07-02 14:21:47 +02:00
Felix Fontein
e6d597b539 Revert "Remove deprecated functionality. (#363)"
This reverts commit 209aeb57fd.
2022-07-02 14:18:53 +02:00
Felix Fontein
57e19ca596 Revert "Remove deprecations from docker_container, bump collection version to 3.0.0 (#399)"
This reverts commit 49ce0a3cb1.
2022-07-02 14:18:48 +02:00
Felix Fontein
7b46e4d414
Deprecate all API versions until 1.24 (#397)
* Deprecate all API versions until 1.24.

* Fix newlines.
2022-07-02 14:18:14 +02:00
Felix Fontein
49ce0a3cb1
Remove deprecations from docker_container, bump collection version to 3.0.0 (#399)
* Remove deprecated features in docker_container.

* Bump collection version to 3.0.0.

* Remove 'published_ports: all' tests.
2022-07-01 19:16:22 +02:00
Felix Fontein
209aeb57fd
Remove deprecated functionality. (#363) 2022-07-01 19:02:22 +02:00
Felix Fontein
00ddbbdeb2
Deprecate Python 2.6 (#388)
* Deprecate Python 2.6 support.

* Document deprecations in README.
2022-06-30 20:47:46 +02:00
Felix Fontein
f41d7ac1b8
Move common utility code to plugins.module_utils.util (#390)
* Move common utility code to plugins.module_utils.util.

* Also adjust plugins.

* Fix import.
2022-06-20 18:39:13 +02:00
Felix Fontein
a44e0736cf
Improve API version handling. (#389) 2022-06-20 07:34:38 +02:00
Felix Fontein
01ca3f0e1c Release 2.6.0. 2022-05-24 12:50:19 +02:00
Rodrigo Candido Gryzinski
497c2fda91
Add image_label_mismatch parameter to docker_container (#370)
* Add image_label_mismatch to docker_container

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* Test image_label_mismatch error message

* Add change fragment for image_label_mismatch

* Break long line in docker_container.py for pep-8 compliance

* pep8 compliance

* Update changelogs/fragments/370-add-image-label-mismatch.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix: add expected_labels to parameters_map in docker_container

* Apply suggestions from code review

* Apply suggestions from code review

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-24 08:35:33 +02:00
Felix Fontein
9580c25579
Deprecate docker-compose EE dependency. (#373) 2022-05-24 08:11:31 +02:00
Felix Fontein
184dd63e55 Prepare 2.6.0 release. 2022-05-24 07:48:07 +02:00
Felix Fontein
401a76ff00
docker_container: fail if there are too many parts in a parsed port (#367)
* Fail if there are too many parts in a parsed port.

* Add tests.

* Prevent bad parsing.
2022-05-22 17:20:05 +02:00
Felix Fontein
1425faadd0
Deprecate Ansible 2.9 and ansible-base 2.10 support. (#361) 2022-05-20 14:46:07 +02:00
Felix Fontein
7e710f743d
Bump deprecations we forgot to remove in 2.0.0. (#362) 2022-05-20 14:45:52 +02:00
Felix Fontein
fb55b1d780
Avoid breakage with Python 3.13. (#354) 2022-05-18 22:22:50 +02:00
Felix Fontein
929a2f6e5f Release 2.5.1. 2022-05-16 12:27:39 +02:00
Felix Fontein
6adc7bddf3
Add PSF-license.txt file. (#350) 2022-05-16 07:35:23 +02:00
Felix Fontein
71fb48b7c5 Prepare 2.5.1 release. 2022-05-16 07:11:56 +02:00
Felix Fontein
1848142d4f Release 2.5.0. 2022-05-14 12:11:04 +02:00
Felix Fontein
e5ba309f03 Prepare 2.5.0 release. 2022-05-11 07:28:08 +02:00
Sasha Jenner
c63ef4116d
Support --template-driver for docker_config (#332) (#345)
* initial templating changes

* adding docs

* author

* responding to pr comments

* testing for idempotency

* using template_driver rather than templating

* adding explicit idem check

* remove local testing changes

* bug fix

* fixing idempotency

Co-authored-by: Sasha Jenner <sasha.jenner@cba.com.au>
2022-05-11 07:26:59 +02:00
chrische
98b227003e
docker_swarm: adds data_path_addr option for swarm init and swarm join (#344)
* adds data_path_addr option for swarm init and swarm join. (ansible-collections/community.docker#339)

* adds changelog fragment (ansible-collections/community.docker#339)

* adds formatting to changelog entry

Co-authored-by: Felix Fontein <felix@fontein.de>

* adds version to doc entry in ansible_swarm

Co-authored-by: Felix Fontein <felix@fontein.de>

* rewrites doc entry to formal language

Co-authored-by: Felix Fontein <felix@fontein.de>

* Correct docker api version (src: docker api docs)

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-09 20:37:27 +02:00
Felix Fontein
2cef29e2e1 Release 2.4.0. 2022-04-25 21:32:27 +02:00
Felix Fontein
497453aab2 Prepare 2.4.0 release. 2022-04-25 20:43:54 +02:00
Brian Coca
6679eee41e
docker connection: handle version and docker_args (#327)
* handle version and docker_args

* Remove breaking change.

* Add changelog fragment.

* Fix unit tests.

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-04-25 20:35:33 +02:00
Shane St Savage
eaacf6c8f6
Support getting container output from local logging driver (#337)
The `local` [Docker logging driver](https://docs.docker.com/config/containers/logging/local/) is a new-ish, optimized local logging driver that improves upon json-file. Since logs written using `local` can still be accessed through the Docker daemon API, all that is needed here is to add to the supported list.
2022-04-24 21:39:59 +02:00
Felix Fontein
e12a487e6a
Add EE support, support GHA in current_container_facts (#336)
* Try adding EE support.

* Use GHA instead of AZP for EE tests.

* Update changelog fragment, extend tests.

* Disable current_container_facts test.

* Increase verbosity.

* 2.9 compatibility.

* Use docker instead of podman for building EE and running tests in it.

* Output some more information (helpful for debugging).

* Fix GHA handling for current_container_facts.

* Try to fix permissions.
2022-04-18 22:54:00 +02:00
Felix Fontein
4be3a64f8a Release 2.3.0. 2022-03-28 20:56:14 +02:00
Felix Fontein
14d3fcd7d2 Prepare 2.3.0 release. 2022-03-27 21:48:06 +02:00
Felix Fontein
3c7c496e67
Implement connection reset. (#312) 2022-03-22 07:13:39 +01:00
Felix Fontein
b353a39ada
Adjust docker_api plugin to ansible-core 2.13. (#308) 2022-03-22 07:11:32 +01:00
Felix Fontein
421b712812
docker connection plugin: simplify actual_user handling code (#311)
* Simplify actual_user handling code.

* Forgot self.
2022-03-22 07:11:14 +01:00
Brian Coca
37a3264042
docker connection plugin: fix config docs and update to use config system (#297)
* fix config docs and update to use config system

 wean off play_context which did not have the correct data in all cases

* moar fixes

* Update plugins/connection/docker.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* updated for backwards compat

* badmergeresolution

* makeitworks

* attempt to fix unit test

* mocking it# No more than 50 chars. #### 50 chars is here: #

* Update plugins/connection/docker.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/connection/docker.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/connection/docker.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/connection/docker.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/connection/docker.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/connection/docker.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* nomock

* remove bad paste

* properly load connection to initialize config

* initizlie docker args

* Fix bugs.

* Call _set_conn_data() when needed.

* Cache result of _get_docker_remote_user() now that it is called multiple times per task.

* Fix unit tests.

* list.clear() is Python 3...

* Add changelog.

* Call _set_conn_data() also in _connect().

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-03-21 19:19:14 +01:00
Felix Fontein
d6c20e76c6 Release 2.2.1. 2022-03-14 21:39:08 +01:00
Felix Fontein
a338327a79 Prepare 2.2.1 release. 2022-03-14 21:15:13 +01:00
Felix Fontein
ba5e6f89f3
Fix warning/error extraction. (#305) 2022-03-14 21:01:35 +01:00
Felix Fontein
ea82ebbd37 Releasing 2.2.0. 2022-02-21 22:10:53 +01:00
Felix Fontein
063c9ed2a6 Prepare 2.2.0 release. 2022-02-19 23:30:59 +01:00
András Maróy
3ad49824db
Implement cap_add and cap_drop handling for docker_swarm_service (#294)
* Implement `cap_add` and `cap_drop` handling for `docker_swarm_service`

* Fix typos in changelog fragment

* Add missing `version_added` docstrings to `docker_swarm_service`

* Check api version too in `docker_swarm_service` capability tests

* Fix API version checking in tests for docker_swarm_service

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add `cap_add` and `cap_drop` to sample output for `docker_swarm_service`

* Use proper diff checking for `docker_swarm_service` capabilities

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-02-12 08:30:44 +01:00
András Maróy
1d062dad5c
Implement rolling_versions for docker_config (#295) 2022-02-12 08:30:09 +01:00
András Maróy
b481fa4801
Add support for rotating docker secrets (#293)
* Add parameters for rolling updates to `docker_secret`

* Extract `remove_secrets` to its own function in `docker_secret`

* Store existing secrets in a list instead of a single secret

With this change `docker_secret` now supports the case where we store
multiple versions of a secret with the `_v123` postfix.

`absent` state implicitly handles removing these this way.

* When using `rolling_versions` don't automatically remove current secret

To make rolling updates actually work instead of failing on trying to
remove a secret that is attached to a service, use the
`versions_to_keep` parameter to remove old versions of the secret after
creating the new one. This way the secret with the new data is created
with a different name and can be attached to the service by its ID
without having to delete the previous one first which would fail if it
is already attached to a service.

* Add version numbers to newly created secrets

Attach the incremental version number to the secret name as a `_v123`
postfix where `123` is replaced with an incremental counter starting
from 1.
A label with the numeric version is also attached to the secret to ease
calculating the new version number upon change with the name
`ansible_version`.

* Return `secret_name` for docker secrets as well

* Add integration test for rolling secrets

* Update `docker_secret` documentation as per review comments

* Correctly return `docker_secret` version number as int

* Use template string for naming `docker_secrets` instead of concatenation

* Return the correct secret name on deletion failure

* Simplify `docker_secret` creation

* Add missing comma for `docker_secret` schema

* Only remove old docker secrets if `rolling_versions` is set

* Add check in `docker_secret` version parsing to handle NaNs

* Add newly created `docker_secret` to internal secret list to avoid additional deletions

* Add changelog fragment for `docker_secret` `rolling_versions` feature

* Update changelogs/fragments/270-rolling-secrets.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-02-12 08:29:49 +01:00
Felix Fontein
9cd46a7d41
Try to make more compatible with podman-docker. (#292) 2022-02-11 12:23:36 +01:00
Felix Fontein
e87b66b806 Release 2.1.1. 2022-01-05 22:33:40 +01:00
Felix Fontein
a11b6f5880 Prepare 2.1.1 release. 2022-01-05 21:17:11 +01:00
Felix Fontein
264f5238c7
Fix unintended breaking change by vendoring distutils.version. (#269) 2022-01-05 20:08:59 +00:00
Felix Fontein
2c855d2391 Release 2.1.0. 2022-01-04 06:42:42 +01:00
Felix Fontein
5cd4b68538 Prepare 2.1.0 release. 2022-01-04 06:16:53 +01:00
Felix Fontein
4b235a2607
Prepare for distutils.version being removed in Python 3.12 (#258)
* Prepare for distutils.version being removed in Python 2.12.

* Fix copy'n'paste error.

* Fix import.

* Re-add Loose prefix.

* Fix Python version typo.

* Improve formulation.

* Move message into own line.

* Fix casing, now that the object is no longer called Version.
2021-12-24 11:28:35 +01:00
Felix Fontein
93ea131f30
Get rid of distutils.spawn. (#257) 2021-12-24 11:27:23 +01:00
Felix Fontein
40576e317b
docker_container_exec: allow to specify environment (#254)
* Allow to specify environment parameters for docker_container_exec.

* Add changelog fragment.

* sorted -> list.
2021-12-22 16:56:22 +00:00
Felix Fontein
02596835b1
Add detach parameter. (#255) 2021-12-22 17:37:08 +01:00
Felix Fontein
5a23c4d336
Set minimal Docker API version for chdir to 1.35. (#253) 2021-12-22 17:14:08 +01:00
Felix Fontein
1b9416b572 Release 2.0.2. 2021-12-09 06:03:52 +01:00
Jeff Goldschrafe
d224752cf1
Minor fixes to nsenter connection plugin (#249)
* Minor fixes to nsenter connection plugin

- Ensure the nsoption_pid option is retrieved in _connect instead of
  __init__ to prevent a crasher due to initialization order
- Replace the use of --all-namespaces with specific namespaces to
  support compatibility with Busybox nsenter (for example, Alpine)

* minor tidy

* Fix PEP8 violation

* Changelog fragment

* Update changelogs/fragments/249-nsenter-fixes.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Jeff Goldschrafe <jeff.goldschrafe@flatiron.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-12-09 05:53:43 +01:00
Felix Fontein
699dd4146e Prepare 2.0.2 release. 2021-12-08 20:24:14 +01:00
Felix Fontein
bed775c4ea
docker_container_exec: improve handling of chdir option (#243)
* Only pass chdir on when it is provided, and prevent this option from being used for Docker SDK for Python < 3.0.0.

* Also fix docker_api connection plugin.
2021-11-30 09:14:34 +01:00
Felix Fontein
b31e7d7d9c Release 2.0.1. 2021-11-13 14:13:44 +01:00
Felix Fontein
772f35c65c Prepare 2.0.1 release. 2021-11-13 13:56:14 +01:00
Felix Fontein
5183f84962 Release 2.0.0. 2021-10-21 07:31:39 +02:00
Felix Fontein
8ecebcefbb Prepare 2.0.0 release. 2021-10-20 17:59:15 +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
Ajpantuso
14f15c0aec
docker_compose - Fix timeout defaulting behavior (#163)
* Initial commit

* Adding changelog fragment

* Updating changelog for breaking change
2021-10-05 08:38:24 +02:00
Felix Fontein
260c17ad91 Release 1.10.0. 2021-10-05 07:34:37 +02:00
Felix Fontein
ce25cb907a Prepare 1.10.0 release. 2021-10-05 07:33:23 +02:00
Felix Fontein
f01dacd6cf
Looks like we forgot to add the new modules to the action_group. (#209) 2021-09-18 17:07:35 +02:00
Felix Fontein
5d861004db
docker_config and docker_secret: add data_src option (#203)
* Add data_src options to docker_config and docker_secret.

* Add examples.

* Fix test.

* Another fix.
2021-09-12 09:42:03 +02:00
Felix Fontein
a56cad3a09 Release 1.9.1. 2021-08-29 13:44:07 +02:00
Felix Fontein
50b3e8a2d4 Prepare 1.9.1 release. 2021-08-27 05:44:06 +02:00
Ajpantuso
4dfc3ae5d7
docker_compose - Fix idempotency when services have no enabled profiles (#192)
* Initial Commit

* Adding integration tests

* Fixing integration and adding changelog fragment
2021-08-20 13:33:35 +02:00
Felix Fontein
36a01c164f Release 1.9.0. 2021-08-03 22:25:13 +02:00
Felix Fontein
930f9d1bcd
Improve error message on import errors. (#188) 2021-08-02 21:04:25 +02:00
Felix Fontein
46bffd2f36 Prepare 1.9.0 release. 2021-08-02 19:33:32 +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
03f649f43c
docker_compose - Fix startup errors for docker-compose versions <1.17.0 (#182)
* Initial Commit

* Adding changelog fragment

* Applying review suggestions
2021-07-31 11:37:02 +02:00
Felix Fontein
72fb3a5d1a
Fix check_mode for some _info modules. (#183) 2021-07-28 21:49:15 +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
9b661a6ac2
docker_compose - add env_file option (#174)
* Initial commit

* Adding changelog and fixing docs

* Fixing integration tests

* Restricting minimum docker-compose versions for tests

* Applying initial review suggestions
2021-07-16 19:01:20 +02:00
Felix Fontein
61d9237eef Move changelog fragment to correct place, and add note that the change was already in 1.8.0. 2021-07-01 07:15:34 +02:00
Felix Fontein
2593c09d49 Release 1.8.0. 2021-06-28 21:03:06 +02:00
Felix Fontein
9e39014baf Prepare 1.8.0 release. 2021-06-28 21:02:40 +02:00
Ajpantuso
072d96ca62
docker_compose - Adding profiles option. (#167)
* Initial commit

* fixing tests

* Adding changelog fragment
2021-06-28 20:54:54 +02:00
Felix Fontein
badcd61a74
Replace ansible.module_utils._text by ansible.module_utils.common.text.converters. (#164) 2021-06-26 13:39:51 +02:00
Ajpantuso
825a4f74d3
docker_plugin - adding alias option and general cleanup (#161)
* Initial Commit

* Adding changelog fragment
2021-06-25 21:45:53 +02:00
Ajpantuso
49c8fd0aa5
docker_host_info - Allow filters which are passed as lists (#160)
* Initial Commit

* Adding integration tests

* Adding example in docs

* Adding changelog fragment

* Applying initial review suggestions
2021-06-22 22:27:38 +02:00
Felix Fontein
af2b3b0493
docker_compose: fix idempotency for stopped services (#159)
* Always use |= instead of = when updating changed status.

* Fix idempotence bug.

* Add changelog fragment.
2021-06-22 12:07:50 +02:00
Felix Fontein
902bcc6193
Pass Docker daemon connection params from inventory to connection plugin (#157)
* Move variable handling to doc fragment, and make them known to module_utils.

* Pass Daemon connection options to connection plugin.

* Add changelog fragment.

* Fix syntax error.

* Forgot 'options:'.
2021-06-22 06:29:56 +02:00
Felix Fontein
5fa0aa073c Release 1.7.0. 2021-06-08 14:05:55 +02:00
Felix Fontein
0d3d5fd6cb Prepare 1.7.0 release. 2021-06-07 07:02:29 +02:00
Felix Fontein
b775bac593
docker_image: allow to tag images by name, improve docs (#149)
* Add test to tag image with ID.

* Document that source=local also works with image IDs.

* Improve 'repository' documentation.

* Fix typo.

* Looks like a fix is needed to make this work.

* ...

* Avoid unnecessary re.search() calls.

* Add changelog fragment.

* Improve main description.

* Remove import.
2021-06-07 07:01:10 +02:00
Felix Fontein
edd14808ee Release 1.6.1. 2021-05-17 13:58:16 +02:00
Felix Fontein
355b29e7d3 Prepare 1.6.1. 2021-05-17 13:55:25 +02:00
Felix Fontein
c20186901b
Only emit tls_hostname deprecation warning if TLS is actually used (#143)
* Only emit tls_hostname deprecation warning if TLS is actually used.

* Linting.
2021-05-17 13:24:50 +02:00
Felix Fontein
36c1b4d818 Relesae 1.6.0. 2021-05-11 07:33:38 +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
9ad7d3490a Prepare 1.6.0 release. 2021-05-10 17:57:22 +02:00
Felix Fontein
3a0d3e15fb
Configure plugin after installing it. (#135) 2021-05-07 07:14:28 +02:00
Felix Fontein
74475d1d9b
docker_swarm_service: fix crash during idempotence check if published_port is not specified (#136)
* Avoid crash during idempotence check if published_port is not specified.

* Add tests.

* Convert lambda to function.
2021-05-05 08:00:22 +02:00
Alexandr N. Zamaraev
859bc29f9e
docker_compose: fix #12 (#119)
* fix #12

* Create 12-correct_pull_wo_starting.yaml

* Update changelogs/fragments/12-correct_pull_wo_starting.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/12-correct_pull_wo_starting.yaml

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update docker_compose.py

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-05-04 07:53:38 +02:00
Felix Fontein
cffba7b15d
Deprecate default for tls_hostname (#134)
* Start removing default.

* Add deprecate() function to AnsibleDockerClientBase.

* Deprecate default value for tls_hostname.

* Add changelog.

* Mention deprecation in documentation.
2021-05-04 07:50:33 +02:00
daeseokyoun
3f8946a369
adds missing changelog fragment file (#126)
* adds missing changelog fragment file

changelog fragment file for #125

* Update changelogs/fragments/125-correct-error-message-for-docker-sdk-version.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-17 13:26:15 +02:00
Felix Fontein
dd03fdbc6a Release 1.5.0. 2021-04-11 16:06:02 +02:00
Felix Fontein
5d7f970bc5 Prepare 1.5.0. 2021-04-11 15:52:19 +02:00
Felix Fontein
a3b9648233
Improve exception handling. (#121) 2021-04-08 08:00:01 +02:00
Felix Fontein
e9b10ee0a4
Add use_ssh_client flag (#114)
* Add use_ssh_client option.

* Unrelated cleanup (unneeded imports).

* Add SSH connection tests.
2021-04-02 10:14:09 +02:00
Felix Fontein
92db288917 Release 1.4.0. 2021-03-14 22:56:10 +01:00
sgpinkus
149a3abbc3
Fix update_failure_action KeyError in docker_swarm_service (#100)
* Fix update_failure_action KeyError in docker_swarm_service.py

* Update plugins/modules/docker_swarm_service.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-03-14 22:52:27 +01:00
Felix Fontein
bfda6439ba Add 1.4.0 release summary. 2021-03-14 22:35:28 +01:00
sgpinkus
5b74313023
Make docker_swarm_service option publish.published_port optional (#101)
* Change docker_swarm_service option publish.published_port from required to optional. If not specified random high port is assigned by docker.

* Update changelogs/fragments/101-make-service-published-port-optional.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-03-13 13:37:56 +01:00
Felix Fontein
b42b76fc45
[security] docker_swarm: mark join_token as no_log (#103)
* Mark join_token as no_log.

* Apply suggestions from code review

Co-authored-by: Piotr Wojciechowski <23406016+WojciechowskiPiotr@users.noreply.github.com>

Co-authored-by: Piotr Wojciechowski <23406016+WojciechowskiPiotr@users.noreply.github.com>
2021-03-12 22:31:39 +01:00
Felix Fontein
e42aadf3e9
docker_swarm_service: flag secrets option as not secret (#102)
* Flag secrets option as not secret.

* Add changelog fragment.
2021-03-12 22:01:11 +01:00
Felix Fontein
8f4f69975b Release 1.3.0. 2021-03-08 02:38:38 +01:00
Felix Fontein
0b82f921b8 Add 1.3.0 release summary. 2021-03-08 02:18:23 +01:00
Felix Fontein
f2d16da643
docker_image: improve/fix handling of image IDs (#87)
* Improve/fix handling of image IDs in docker_image.

* Fix syntax error.

* Linting.

* Fix name collision.

* Add various tests.

* Fix tests.

* Improve image finding by ID, and fix various related bugs.

* accept_not_there -> accept_missing_image.

* Remove unnecessary dummy variable.
2021-02-28 10:40:11 +01:00
Felix Fontein
ed9bf1117f
docker_image: allow to specify pull platform (#89)
* Allow to specify pull platform.

* Add basic test and document that the value is not used for idempotency at the moment.

* Fix pulling.

* Simplify code.

* Add API version for pull_platform.

* Move pull_platform into new pull option. Use apply_defaults=True to avoid some special logic.

* Add example.

* Remove apply_defaults=True.
2021-02-24 23:45:34 +01:00
Felix Fontein
f107ab281f
Add storage_opts option. (#93) 2021-02-24 23:01:34 +01:00
Piotr Wojciechowski
3ddd75ac68
Replicas max per node (#92)
* Adding 'replicas_max_per_node' placement parameter

* Adding 'replicas_max_per_node' placement parameter

* Adding 'replicas_max_per_node' integration tests

* Adding 'replicas_max_per_node' feature

* 'replicas_max_per_node' documentation update

* 'replicas_max_per_node' unit test fix

* Documentation and changelog updates

* Update changelogs/fragments/92-replicas-max-per-node.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: WojciechowskiPiotr <devel@it-playground.pl>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-24 10:14:06 +01:00
Felix Fontein
f5d68755c4
Fix healthcheck idempotency issue with strict comparison. (#88) 2021-02-17 22:56:52 +01:00
Felix Fontein
bbf8373f6c Release 1.2.2. 2021-02-05 17:52:24 +01:00
Felix Fontein
2d48253b6d Prepare 1.2.2 release. 2021-02-05 17:51:48 +01:00
David Moreau Simard
58babf738b
docker swarm - Add no_log to the signing_ca_key argument (#80)
* docker swarm - Add no_log to the signing_ca_key argument

This will prevent accidental disclosure.

See: CVE-2021-20191

* Update changelogs/fragments/CVE-2021-20191_no_log.yml

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-04 21:03:43 +01:00
Felix Fontein
bcd1201af6 Release 1.2.1. 2021-01-28 07:43:11 +01:00
Felix Fontein
e957b885f8 Prepare 1.2.1 bugfix release. 2021-01-28 07:41:44 +01:00
Romain Lalaut
43cbe3095b
docker.py: allow docker versions beginning with 'v' (#76)
* docker.py: allow docker versions with a leading 'v'

* Update changelogs/fragments/76-leading-v-support-in-docker-version.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-01-27 14:16:35 +00:00
Felix Fontein
4df5a7468a Release 1.2.0 2021-01-25 17:58:21 +01:00
Felix Fontein
fa18833c10 Add release summary. 2021-01-25 17:14:05 +01:00
Felix Fontein
8702713ac3
docker_image: do not crash in load_image for docker-py < 2.5.0. (#73)
* Avoid crash for docker-py < 2.5.0.

* Add warnings when load_image does not return a generator.

* Add test.

* Update plugins/modules/docker_image.py

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2021-01-25 15:17:04 +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
2ad8a0812a Fix changelog fragment. 2021-01-22 07:58:40 +01:00
Felix Fontein
6adb148675
Add default_host_ip option. (#71) 2021-01-20 23:53:23 +01:00
Felix Fontein
9fa08824e2 Release 1.1.0. 2021-01-03 13:43:34 +01:00
Felix Fontein
04f5c7e0c9 Add 1.1.0 release summary. 2021-01-03 13:43:04 +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
5eef093e99
Check output of load_image and react upon. (#55) 2020-12-27 15:04:38 +01:00
Felix Fontein
1277942a4e
Deprecate current behavior when specifying all with other port mappings. (#60) 2020-12-26 18:20:52 +01:00