Commit Graph

78 Commits

Author SHA1 Message Date
Felix Fontein
5bfec5d4d2
Add 'idempotent' attribute (#1022)
* Add 'idempotent' attribute.

* Mention check mode in attribute description.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2024-12-30 21:11:14 +01:00
Felix Fontein
bd992583c2 Improve formulations. 2024-12-28 17:09:33 +01:00
Felix Fontein
769d15de63
Reformat documentation with 'andebox yaml-doc' (#1020)
* Reformat documentation with 'andebox yaml-doc'.

* Revert unwanted changes.

* Fix too long lines.

* Fix broken quotes.

* Forgot two line breaks.
2024-12-28 16:40:50 +01:00
Michael
6595d299e2
Doc fix for docker_container image_name_mismatch (#991)
* doc-fix-image-name-mismatch

* Update description.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-11-23 14:12:27 +01:00
Felix Fontein
f7823ea626
Prepare 4.0.0 release. (#971) 2024-10-18 21:01:49 +02:00
Felix Fontein
2ddadf1e2b
docker_container: pass networks to Daemon on container creation (#933)
* Pass networks to Daemon on container creation.

* Restore old behavior, and only provide all networks on creation for API 1.44+.
2024-07-23 17:34:26 +02:00
Felix Fontein
4b7e74b75e
docker_container: allow to wait for a container to become healthy (#921)
* Allow to wait for a container to become healthy.

* Improve wording.

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

* Improve explanation.

---------

Co-authored-by: Don Naro <dnaro@redhat.com>
2024-07-09 20:07:00 +02:00
Fran Jurinec
9b5dbd4543
Add support from device_cgroup_rules parameter (#910) 2024-07-04 09:51:32 +02:00
Felix Fontein
36dcb94b39
Document host-gateway. (#897) 2024-06-28 17:03:32 +02:00
x4rd0o1Vtx
5016a96eba
Allow healthcheck override without test option (#847)
* Add healthcheck test_cli_compatible option

* Update plugins/module_utils/util.py

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

* Update plugins/modules/docker_container.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-05-15 18:45:01 +02:00
x4rd0o1Vtx
a4a05e7fa5
Add healthcheck start-interval option (#848) 2024-05-09 21:22:06 +02:00
Felix Fontein
6366464812
docker_container: allow pull=never, and make check mode behavior configurable (#797)
* Allow to configure behavior of pull=true in check mode.

* Change pull to option that accepts some strings as well, such as pull=never.

* Adjust values.
2024-02-14 22:49:22 +01:00
Felix Fontein
fcf608b334
Add networks[].mac_address option. (#763) 2024-01-20 14:23:12 +01:00
Felix Fontein
648e0652d5
mac_address no longer works with Docker API v1.44+. (#764) 2024-01-20 14:06:29 +01:00
Felix Fontein
0812d0b495
Support labels and shm_size for image build. Allow to specify (swap) memory limits in other units than bytes. (#727) 2023-12-28 21:42:55 +01:00
Felix Fontein
c4c347c626
Add proper platform handling. (#705) 2023-12-10 09:03:32 +01:00
Felix Fontein
907dc28f73
Deprecate default 'ignore' of 'image_name_mismatch'. (#703) 2023-12-07 12:32:50 +01:00
Felix Fontein
024bdec919
Use semantic markup (#645)
* Use semantic markup.

* Linting.

* Define docsite targets.

* Forgot one env var.

* Add array stubs.
2023-06-22 07:01:31 +02: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
311926aaad
Forgot to switch docs fragment for docker_container: it no longer depends on the Docker SDK for Python. (#544) 2023-01-01 21:54:35 +01:00
Felix Fontein
2261dff49f
Document attributes (#497)
* Add 'docker' action group attribute.

* Compatibility with older ansible-core releases.

* Fix typo.

* Docment standard attributes.

* Improve docs.

* Add shortcuts for common combinations.
2022-11-06 21:15:09 +01:00
Felix Fontein
5b31f17016
Add image_name_mismatch option. (#488) 2022-11-01 19:48:58 +00: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
1bf8da2390
Normalize booleans in docker_container docs. (#439) 2022-08-09 18:32:05 +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
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
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
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
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
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
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
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
seffyB
6ff739390e
Update docker_container.py (#378)
##### Correct Typo in the word compatibility
Change all occurrences of `compatiblity` to be `compatibility` as it looks to be a typo.
For example, when running a task with `command_handling: compatiblity` an error will be thrown stating an invalid value


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2022-06-01 07:38:51 +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
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
fb55b1d780
Avoid breakage with Python 3.13. (#354) 2022-05-18 22:22:50 +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
addisonshelley
69399d736d
Update docker module documentation for log_options (#317)
* Update docker module documentation for log_options

Add that log_driver must be specified for log_options to take effect

* Update plugins/modules/docker_container.py

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-03-27 15:30:23 +02:00
Felix Fontein
fbbc0898ed
More small docs fixes. (#281) 2022-01-10 07:42:40 +01:00
Felix Fontein
3d20ba1bc2
Improve documentation (#278)
* Improve documentation.

* More fixes.
2022-01-09 14:52:44 +01:00
Richard James Acton
15ab747d86
Added cap_add to the documentation for capabilities for easier search (#265)
* added cap_add to the documentation for capabilities for easier search comming from docker

* added equivalent syntax for docker cli and compose to capabilities docs

* added equivalent syntax for docker cli and compose to capabilities docs
2022-01-05 13:09:22 +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
5233936262
Fix docs issues. (#232) 2021-11-09 19:59:28 +01: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
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
Lauri Tirkkonen
a0f2091e6a
put example addresses in actual RFC1918 range (#170)
172.1/16, 172.3/16 and 172.4/16 are not in the 172.16/12 range.

https://datatracker.ietf.org/doc/html/rfc1918#section-3
2021-07-01 19:06:18 +02:00