Commit Graph

162 Commits

Author SHA1 Message Date
Felix Fontein
54a3dc151d
Remove unneccessary imports (#575)
* Remove unneccessary imports.

* Add noqas.
2023-02-09 15:25:45 +01:00
Felix Fontein
421bae419d
Improve current_container_facts docs (#574)
* Improve current_container_facts docs.

* [TEMP] Run current_container_facts module in CI outside of ansible-test.

* Revert "[TEMP] Run current_container_facts module in CI outside of ansible-test."

This reverts commit 1cdd3e3550.

* Describe current state of return values.
2023-02-03 17:13:31 +01:00
David Jack Wange Olrik
c24ea78f6e
docs: Fix json path in asserts (#560)
##### SUMMARY

The current path to the running state does not include `output.services.` which it should.

##### ISSUE TYPE

- Docs Pull Request

+label: docsite_pr
2023-01-20 13:19:33 +01:00
Felix Fontein
b114d451fd Forgot to add version_added. 2023-01-14 11:19:42 +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
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
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
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
e87b327764
Improve container detection. (#522) 2022-12-06 08:11:44 +01:00
Felix Fontein
6ccbde9f98
Fix chdir option. (#518) 2022-12-02 06:48:39 +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
iamjpotts
ee9ddb954f
Add docstring to ImageManager.__init__ and fix docstring for ImageManager.archive_image (#509) 2022-11-30 22:04:11 +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
1ac3a99e7c
Fix non-matching defaults. (#494) 2022-11-01 18:08:45 +01:00
James A. Robinson
df864221d6
added documentation to indicate docker_swarm_service does not currently support operating on stack based services. (#491) 2022-10-26 12:49:59 +02:00
Felix Fontein
3b41e7d6a8
Improve docker_compose example (#470)
* Improve compose docs.

* Also adjust inline v1 example.
2022-09-08 06:33:06 +02:00
Felix Fontein
9458bc6e62
Clarify that BuildKit / buildx cannot be used with docker_image. (#468) 2022-09-07 21:52:38 +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
1e24120014
Fix two more booleans. (#464) 2022-08-23 21:26:50 +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
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
be58ccc13f
Normalize booleans in all other plugins and modules. (#440) 2022-08-10 21:25:10 +02:00
Felix Fontein
1bf8da2390
Normalize booleans in docker_container docs. (#439) 2022-08-09 18:32:05 +02:00
Felix Fontein
bc6757d3b8
Fix docs. (#436) 2022-08-04 14:23:52 +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
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
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
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
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